SYSTEM Cited by 1 source
Cloudflare Queues¶
Cloudflare Queues is Cloudflare's messaging primitive on the Developer Platform: producers write messages from Workers, a configured consumer Worker receives batches with tunable size and timeout, and the queue handles delivery + retry + dead-lettering. Documented at developers.cloudflare.com/queues.
Role¶
- Decoupling — producer Workers don't block on the consumer.
- Batching as throughput-amortisation — the
max_batch_size×max_batch_timeouttwo-knob trigger lets a consumer Worker drain N messages per invocation and bulk-process them (canonical use: bulk-write to D1 / external DBs / external APIs). - Per-region partitioning — by convention, queues are named
per-region (
-weur,-eeur,-wnam, etc.) when the consumer's downstream is a regionally-sharded substrate (e.g. D1 with location hints).
Canonical config (from Browser Run, 2026-05-13)¶
{
"queues": {
"consumers": [
{
"queue": "production-core-containers-queue-weur",
"max_batch_size": 100,
"max_batch_timeout": 1,
"max_retries": 1
}
]
}
}
The two batching knobs (max_batch_size: 100, max_batch_timeout: 1
second) are the load-bearing primitives for the
patterns/queue-batching-amortizes-db-write-throughput pattern —
the consumer drains either when 100 messages are buffered or when
1 second elapses, whichever fires first.
Seen in¶
- sources/2026-05-13-cloudflare-browser-run-now-running-on-cloudflare-containers-its-faster
— canonical wiki instance for Queues as a DB-write
throughput multiplier. Browser Run runs ~thousands of containers
per location, each updating its state every 5 seconds; without
batching, the per-row D1 write rate caps the per-location
ceiling at ~5,000 containers (1 ms / row × 1,000 writes/sec).
Queues at
max_batch_size: 100, max_batch_timeout: 1makes each consumer drain a 100-row batch which D1 commits at P95 0.1 ms — the same wall-clock cost as a single-row write — lifting the per-location ceiling to 500,000 containers (a 100× headroom multiplier) at <2-second steady-state lag. Same post canonicalises a paired backup-region fallback for the case when a primary queue's lag exceeds the staleness budget — the queue's job is allocation-control-plane freshness, not data-plane carrying-over.
Related¶
- systems/cloudflare-workers — producer + consumer substrate.
- systems/cloudflare-d1 — canonical downstream consumer; the 100×-headroom math depends on D1's batch-write efficiency.
- systems/cloudflare-kv — sibling primitive that Queues + D1 replaced for the Browser Run hot-allocation path (Queues+D1 give transactional commit + bounded lag, KV gives edge-replicated eventual reads).
- systems/cloudflare-durable-objects — frequent producer in per-instance state-update pipelines.
- systems/cloudflare-browser-rendering — canonical wiki consumer in the Browser Run state-tracking pipeline.
- patterns/queue-batching-amortizes-db-write-throughput — the pattern Queues is the canonical Cloudflare-platform substrate for.
- patterns/region-fallback-on-queue-backlog — the backup posture for queue-fed control planes.
- companies/cloudflare — operator.