Repository navigation
Description
Problem Statement
Multi-replica Async Processors are not officially supported today, but nothing says so. Parts of the code and the docs assume they work.
What exists today:
- The chart supports one replica only.
replicas: 1is hardcoded (ap-deployments.yaml#L51), with noreplicaCount, PDB or topology-spread values. - No test runs more than one processor. Every e2e manifest uses
replicas: 1. The only multi-instance test is a unit test of the leased rate gate with a simulated second instance. - There is no issue, design doc or support statement for running several processors.
Some features were designed for several replicas, but none of it has been validated with more than one processor:
- Durable dequeue: "Multiple Async replicas may share one queue: atomic claims prevent double dispatch, and lease expiry hands work over automatically when a replica disappears" (
durable-dequeue.md#L98-L100).- The reclaimer runs on every instance through a Lua script, so "survivors take over their in-flight work" (
claim.go#L368). - The retry mover guards against double moves with
ZRem(sortedset_impl.go#L1454).
- The reclaimer runs on every instance through a Lua script, so "survivors take over their in-flight work" (
redis-leased-rate(feat: enforce leased Redis dispatch rates #424): "All Async replicas using the samecontrol_keyandstate_keyshare one aggregate token bucket" (dispatch-gates.md#L172-L173).redis-quota: counters live in Redis and are updated by atomic Lua.- Durable result delivery: lease expiry "fences stale replicas".
sqltransport (experimental):- Processors split 64 partitions per queue between them, with
lease_ttl_seconds(30s) andhandoff_timeout_seconds(900s) for takeover (transports.md#L47,#L76-L77). - Schema migrations take an advisory lock so that "several replicas starting at once" is safe.
- Processors split 64 partitions per queue between them, with
Some features are per-process, or are known to behave differently with several replicas:
local-max-concurrencycaps in-flight requests "from a single queue locally" (local_concurrency_gate.go#L21-L22). With N replicas, the effective cap is N ×max_concurrency.- Metric-based gates read the same global signal but decide independently:
prometheus-saturation,prometheus-budget,prometheus-query,endpoint-scrapeandtier-priority-admission. Each replica polls on its own cache TTL, so N replicas can each act on the same open budget between refreshes. Nobody has measured how much overshoot that causes.endpoint-scrapealso multiplies scrape load on the EPP by N. wait-on-refuseand gate-wait park requests in each replica's memory.- Merge policies (random-robin, tier-priority) run in-process, so fairness across tenants holds per replica, not globally.
async_broker_backlogis reported identically by every replica (metrics.go#L121), sosum()over-counts. The in-process gauges (queue depth, gate waiting, in-flight) are per replica and do needsum(). KEDA triggers and dashboards built on these metrics have to aggregate each one correctly.- Deprecated
redis-pubsubsends every message to every replica, so work is duplicated, not shared.
Docs already recommend multiple replicas. The llm-d sizing guide says "Scaling is horizontal and stateless … no leader election or coordination is required" and has a "Horizontal Scaling" section telling operators to scale out once a replica is comfortably sized (async-processor.md#L18, §4). It uses a single-replica benchmark ("a single replica destabilized past ~256" concurrency) as the reason to add replicas. Multiple replicas were never measured, and the chart offers no way to set a replica count.
The upgrade work in llm-d/llm-d#3073 (#560–#563) is deliberately scoped to a single replica for this reason.
Proposed Solution
Until the validation below is done, stop recommending more than one replica; that is the interim step in item 5. Then validate and test multi-replica deployments, and either declare them supported (per transport and per gate), or document what doesn't work.
1. Define the support matrix, and record the result for each cell:
| Area | Expectation to validate with 2–3 replicas |
|---|---|
redis-sortedset |
No double dispatch, no loss, exactly one terminal record per request. Survivors redeliver a killed replica's claims within the lease TTL. The retry mover and reclaimer are safe when run concurrently. Redis cluster/sentinel modes behave the same. |
gcp-pubsub |
The subscription load-balances across replicas. MaxOutstandingMessages is per replica. Behaviour is correct on nack and redelivery. |
sql (experimental) |
Partitions rebalance on scale-up and scale-down. Handoff is bounded by handoff_timeout_seconds. Takeover after a crash is bounded by lease_ttl_seconds. Migrations are safe under concurrent startup. |
redis-pubsub (deprecated) |
Unsupported with more than one replica: the chart refuses to render it, or the processor logs a warning. |
Shared gates: redis, redis-leased-rate, redis-quota, sql-quota |
The aggregate across all replicas stays within the configured limit. |
Metric gates: prometheus-*, endpoint-scrape, tier-priority-admission |
Overshoot measured as a function of replica count and cache TTL. Document a recommended TTL, or a per-replica budget share if one is needed. |
local-max-concurrency |
Document the per-replica semantics (effective cap = N × limit). |
| Merge policies, fairness | Measure fairness across replicas. Document per-replica fairness, or propose a shared mechanism. |
| Metrics | Decide which series to aggregate with max and which with sum. Fix any series that should be emitted once (e.g. broker backlog), or label it so it can be de-duplicated. |
| Lifecycle | Scale up and down under load, a rolling update with N replicas, a node drain with a PDB, and killing one replica. In every case no work is lost and nothing stalls beyond the lease TTL. |
2. Tests:
- Multi-replica e2e (2 or more replicas, simulator), per supported transport, covering the lifecycle row above. Assert exactly-once terminal records and no loss.
- Gate e2e: with several replicas, measure aggregate dispatch rate and in-flight count against the limits of the shared and metric gates.
- Benchmark: does throughput scale with replicas past the single-replica knee (~128–256 concurrency in the llm-d sizing sweep)? Is the gateway/EPP connection path the limit instead? Can be run under the benchmarking epic [Epic]: End-to-End Async Request Queue & Batch API Benchmarking (inference-perf + llm-d-benchmark) #536.
3. Chart, behind the validation results:
replicaCount.- An optional PodDisruptionBudget, which only makes sense with 2 or more replicas.
- Topology-spread or anti-affinity defaults.
- An explicit strategy.
- Render-time rejection of unsupported combinations, such as
redis-pubsubwith more than one replica.
4. Guide: add docs/guides/multi-replica.md, covering:
- the supported transports and gates, from the matrix;
- per-gate semantics with N replicas;
- sizing (
total in-flight = replicas × concurrency, and when adding replicas helps); - metric aggregation for dashboards and KEDA (
maxvssum, per series); - failure, scale-down and upgrade behaviour with N replicas.
Link it from the README and from the llm-d sizing guide.
5. Docs fixes:
- Interim, now: change llm-d
docs/operations/components/async-processor.md§1 and §4 to say a single replica is supported and multi-replica is not yet. Add a support note next to the multi-replica statement indurable-dequeue.md#L98-L100. - After validation: replace them with the validated guidance.
6. Follow-ups to the upgrade issues once supported: revisit #560 (replica count and PDB), #561 (claim handback with peers), #562 (upgrade guide for N replicas) and #563 (upgrade e2e with N replicas).
Exit criteria
- The support matrix is published in the guide, with every cell marked supported, unsupported or experimental.
- The multi-replica e2e runs nightly for each supported transport.
- The chart exposes
replicaCountfor the supported configurations. - The llm-d sizing guide matches the matrix.
Related: llm-d/llm-d#3073, #536, #424, #404.
Activity
tryambak2019 commentedon Nov 19, 2026
Hi @jtechapps, kindly confirm
Proposed Milestone 1
Proposed Later Milestones
jtechapps commentedon Nov 19, 2026
deprecated Redis Pub/Sub testing and support is not needed.
jtechapps commentedon Nov 19, 2026
For milestone 1, also need to verify how gate saturation and dispatch works under load. Whether worker pool worker count is linear to number of replicas. Also need to mention behavior of request ordering when multiple-replicas read from the same request queue.
tryambak2019 commentedon Nov 20, 2026
@jtechapps
I opened #574 for Milestone 1. The tests show that saturated replicas leave requests in the queue, then resume dispatch when saturation clears. Worker capacity increases with replica count. Requests are selected by score, but results may finish out of order.
Could you review?
tryambak2019 commentedon Nov 25, 2026
@jtechapps, thank you very much for merging #574.
kindly confirm the proposed Milestone 2:
jtechapps commentedon Nov 25, 2026
LGTM on milestone 2
tryambak2019 commentedon Nov 25, 2026
@jtechapps
Milestone 2 is ready for your review in PR #593
It adds:
Could you kindly review?