Skip to content

Scaling Model

Scaling model

ChokaQ scales by adding workers, tuning concurrency, controlling per-queue capacity, and keeping SQL queries/indexes healthy.

Scaling Dimensions

DimensionWhat it changes
More app instancesMore fetchers and processors.
Higher worker capacityMore concurrent handler execution.
Per-queue max workersFairness and downstream protection.
Retry/backoff tuningPressure during failure.
SQL sizing/indexesStorage coordination throughput.

Primary Saturation Signal

Queue lag is the main signal. Depth can be misleading because ten slow jobs can be worse than ten thousand tiny jobs. Lag measures how long eligible work waits.

Bottlenecks

BottleneckSymptomFirst response
Handler/downstream slowActive workers high, lag rising.Increase downstream capacity or reduce per-queue workers.
SQL latencyFetch/retry/heartbeat delays, health degraded.Check indexes, waits, command timeouts.
Poison jobsDLQ grows by type/reason.Fix handler/payload; avoid bulk retry storm.
Under-provisioned workersPending lag rises while SQL is healthy.Add instances or increase capacity.
Bad retry policyRetry rate spikes and lag grows.Increase backoff/jitter, use circuit breaker.

Horizontal Scaling

Multiple workers can fetch concurrently because SQL row locks and ownership predicates coordinate claims. More workers help until SQL or downstream systems become the bottleneck.

Additional Questions

What happens at 10x load?
First watch queue lag, SQL waits, active workers, and downstream latency. Add workers only if SQL/downstream are not already saturated.

What happens at 100x load?
You may need provider specialization, partitioning, stricter queue isolation, or a broker/log architecture depending on workload shape.

How would you autoscale?
Use queue lag and processing duration, not just CPU or queue depth.

Apache 2.0 Licensed