# DEFAULT_IMQ_DRAIN_TIMEOUT variable · @imqueue/rpc

Source: https://imqueue.org/api/rpc/latest/rpc.default_imq_drain_timeout/
Published: 2026-08-31
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/rpc 3.9.0 — generated reference, not hand-written

Default drain budget in milliseconds, used when neither [IMQServiceOptions.drainTimeout](https://imqueue.org/api/rpc/latest/rpc.imqserviceoptions.draintimeout/) nor the `IMQ_DRAIN_TIMEOUT` environment variable is set.

**Signature:**

```typescript
DEFAULT_IMQ_DRAIN_TIMEOUT = 4000
```

## Remarks

Chosen to sit below the `imq stop` CLI's escalation window: the CLI signals the process group, then polls liveness 20 times at 250 ms (\~5 s) before sending `SIGKILL`. A budget above that would let the local CLI kill a draining service harder than a cluster would, which is backwards. 4000 ms leaves roughly a second of headroom for `stop()`, `destroy()` and process teardown inside that window.

Kubernetes is not the binding constraint here — its `terminationGracePeriodSeconds` defaults to 30 s — so raise this (and the CLI is then the odd one out) only for deployments that never use `imq stop`.

