dev · 2026-05-01
Project SQS / Kafka / RabbitMQ workers needed to handle a target throughput, given message processing time and worker count.
| Peak messages / second | 250 |
| Avg processing time (ms) | 180 |
| Target worker utilization % | 70% |
| Worker $/month | $65 |
| Monthly cost | $4,225 |
| Messages/worker/sec at target util | 3.9 |
| Workers needed at 100% target | 45 |
Workers handle messages serially in their main loop. Per-worker throughput = 1000 ms/sec ÷ avg processing time. Total throughput = workers × per-worker throughput. Reverse the equation to size your fleet.
per-worker throughput at 100% util = 1000 ÷ avg ms per message
target throughput = 100% throughput × utilization target
workers needed = peak msg/sec ÷ target per-worker throughput
Default scenario: 250 msg/sec peak, 180ms avg, 70% target util:
Above 80% utilization, queues grow during normal variance (worker GC pauses, slow upstream, brief network blips). Above 90%, single-worker failure cascades to backlog. 70% target absorbs typical operational variance.
Default: scale up at 100 messages/queue depth × current workers, scale down to 70% of peak after 30 minutes idle.
60-75% for batch workloads. 50-65% for latency-sensitive. 80%+ only if you have aggressive autoscaling that adds capacity in <60 seconds. Above 80% sustained = fragile system.
Many thin workers: better fault isolation (1 dies, others handle traffic), faster autoscaling, smaller blast radius. Single fat worker: simpler ops, lower per-instance overhead, less coordination cost. Default many-thin unless you have specific reason (GPU, large in-memory state) for fat.
Two patterns: (1) separate queue per priority with dedicated worker pool, (2) single queue with priority field + workers that prefer high-priority. Pattern 1 is simpler, scales independently, easier to reason about. Pattern 2 is more efficient but harder to operate. Most teams pattern 1.