Change history
Every change to this page, newest first. Expand an entry to see what changed.
- 21 Oct 2026 · +13 −10 lines
Show changes
# Queue and congestion - > **TL;DR** — Submit answers tell you how many of your runs are running and waiting, and your limit. `GET /v2/queue` shows the same numbers live. `GET /v2/queue/log` gives them per minute or per hour, `GET /v2/queue/refusals` lists refused submits, and `GET /v2/queue/episodes` lists congestion episodes. Subscribe to `queue.congestion_started` and `queue.congestion_ended` to switch to your fallback early. + > **TL;DR** — Submit answers tell you how many of your runs are running and waiting, and your limit. `GET /v2/queue` shows the same numbers live. `GET /v2/queue/log` gives them per minute or per hour, `GET /v2/queue/refusals` lists refused submits, and `GET /v2/queue/episodes` lists congestion episodes. Subscribe to `queue.congestion_started` and `queue.congestion_ended` to switch to your fallback early. Over your slots, runs wait in line and start as slots free: a busy product makes runs slower, it does not refuse them. You only ever see your own product's numbers. Test keys and live keys count apart. ⋯ |---|---| | Concurrency slots | How many runs of your product run at once. The default is 20; Wandura raises it per product on request. | - | Queue | Priority runs that were accepted and wait for a slot. It holds as many runs as you have slots. | - | Refusal | A submit answered `429` because your product was at its limits. The reason is `product_busy` (slots and queue full) or `rate_limited` (over the per-minute run limit, answered `gateway_rate_limited`). No run was made and nothing was charged. | + | Queue | Priority runs that were accepted and wait for a slot. It has no length limit: they start oldest first as slots free. | + | Refusal | A submit answered `429` because your product was at its limits. The reason is `rate_limited` (over the per-minute run limit, answered `gateway_rate_limited`), or `product_busy` (slots and queue full: only while Wandura has an emergency queue limit on, normally never). No run was made and nothing was charged. | | Congestion episode | A stretch of time your product was in one kind of congestion: `refusing`, `near_full` or `slow`. It has a start and an end. | ⋯ | Header | Meaning | |---|---| - | `X-Concurrency-Limit` | Your concurrency slots. Your queue holds as many again. | + | `X-Concurrency-Limit` | Your concurrency slots. | | `X-Concurrency-Running` | Runs of your product using a slot right now. | | `X-Concurrency-Waiting` | Priority runs of your product waiting for a slot. | ⋯ ``` - When Running and Waiting both reach Limit, a new priority run is refused: `429 product_busy` (Jobs API: `PRODUCT_BUSY`) with `Retry-After: 5`. Relax runs are never refused for this; they wait. + When Running reaches Limit, new runs wait in line (Waiting grows) and start oldest first as slots free. They are not refused. A priority run's deadline (its promise, or a job's `max_job_seconds`) starts when the run starts: time in line does not count. A priority run still waiting after 6 hours ends `priority_late` (Jobs API: `timeout`), not charged; this is a safety net, not something to expect. + Only while Wandura has an emergency queue limit on can a priority submit be refused with `429 product_busy` (Jobs API: `PRODUCT_BUSY`) and `Retry-After: 5`. Relax runs are never refused for this. + - A submit refused before it reaches your limits (a bad body, an unknown style, a bad key) has no such headers. - Treat the headers as optional: if the numbers cannot be read for a moment, the answer comes without them. ⋯ "queue_limit": 20, "accepted_this_minute": 41, - "per_minute_limit": 60, + "per_minute_limit": 2400, "refusals": { "last_15m": 0, "last_24h": 3 }, "at": "2026-10-15T09:30:12.000Z" ⋯ | `running` | Runs using a slot now. | | `waiting` | Priority runs waiting for a slot now. | - | `queue_limit` | How many priority runs may wait. The same number as your slots. | - | `per_minute_limit` | Runs per minute for gateway keys and the Jobs API. Over it: `429 gateway_rate_limited` (Jobs API: `RATE_LIMITED`). | + | `queue_limit` | Informational. A long queue is not refused; only under an emergency queue limit is a new priority run refused once `running` reaches `concurrency_limit` and `waiting` reaches `queue_limit`. | + | `per_minute_limit` | Runs per minute for gateway keys and the Jobs API (default 2400 on live keys, 60 on test keys). Over it: `429 gateway_rate_limited` (Jobs API: `RATE_LIMITED`). | | `accepted_this_minute` | Runs counted against that limit since the start of the current UTC minute. | | `refusals` | Refused submits in the last 15 minutes and the last 24 hours. | ⋯ ``` - `reason` is `product_busy` (slots and queue full) or `rate_limited` (the per-minute run limit). `end_user_id` is `null` when the call sent none. Use it to find which of your users were affected. + `reason` is `rate_limited` (the per-minute run limit) or `product_busy` (slots and queue full, only under an emergency queue limit). `end_user_id` is `null` when the call sent none. Use it to find which of your users were affected. ## Congestion episodes {#episodes} ⋯ ## What to do {#what-to-do} - - **Watch the headers.** When `X-Concurrency-Waiting` climbs toward `X-Concurrency-Limit`, slow down or send new work to your fallback before you are refused. + - **Watch the headers.** A growing `X-Concurrency-Waiting` means your runs wait longer before they start. If your users need a result fast, send new work to your fallback or tell them it will take longer. + - **Time out from the start, not from submit.** Count a job's maximum time from when it turns `processing` (run: `running`). While it is `queued`, keep waiting for the webhook or keep polling. - **Act on the events.** On `queue.congestion_started`, switch to your fallback: at once for `refusing`, early for `near_full`, and for `slow` warn your users or use a faster path. On `queue.congestion_ended` of the same kind, switch back. - **On `429`** (`product_busy`, `gateway_rate_limited`; Jobs API `PRODUCT_BUSY`, `RATE_LIMITED`): no run was made, so sending the request to your fallback cannot run it twice. To retry with Wandura, wait `Retry-After` seconds (add a little jitter) and resend with the **same** `Idempotency-Key`. ⋯
- 15 Oct 2026 · Page created