Skip to content

Scaling Model

Scaling model

ChokaQ scales by adding workers, tuning concurrency, controlling per-queue capacity и 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 - главный signal. Depth может вводить в заблуждение: ten slow jobs могут быть хуже, чем ten thousand tiny jobs. Lag измеряет, как долго 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 healthy.Add instances or increase capacity.
Bad retry policyRetry rate spikes and lag grows.Increase backoff/jitter, use circuit breaker.

Horizontal scaling

Multiple workers могут fetch concurrently, потому что SQL row locks и ownership predicates coordinate claims. More workers помогают, пока SQL или downstream systems не станут bottleneck.

Дополнительные вопросы

Что будет при 10x load?
Сначала смотрите queue lag, SQL waits, active workers и downstream latency. Добавляйте workers только если SQL/downstream еще не saturated.

Что будет при 100x load?
Может понадобиться provider specialization, partitioning, stricter queue isolation или broker/log architecture, в зависимости от workload shape.

Как autoscale?
Используйте queue lag и processing duration, а не только CPU или queue depth.

Лицензия Apache 2.0