Skip to content

[Feature]: Validate, test and document multi-replica Async Processor deployments #564

Open

Description

@jtechapps

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: 1 is hardcoded (ap-deployments.yaml#L51), with no replicaCount, 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).
  • redis-leased-rate (feat: enforce leased Redis dispatch rates #424): "All Async replicas using the same control_key and state_key share 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".
  • sql transport (experimental):
    • Processors split 64 partitions per queue between them, with lease_ttl_seconds (30s) and handoff_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.

Some features are per-process, or are known to behave differently with several replicas:

  • local-max-concurrency caps 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-scrape and tier-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-scrape also multiplies scrape load on the EPP by N.
  • wait-on-refuse and 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_backlog is reported identically by every replica (metrics.go#L121), so sum() over-counts. The in-process gauges (queue depth, gate waiting, in-flight) are per replica and do need sum(). KEDA triggers and dashboards built on these metrics have to aggregate each one correctly.
  • Deprecated redis-pubsub sends 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-pubsub with 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 (max vs sum, 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 in durable-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 replicaCount for the supported configurations.
  • The llm-d sizing guide matches the matrix.

Related: llm-d/llm-d#3073, #536, #424, #404.

Activity

  1. added
    enhancement
    on Nov 18, 2026
  2. tryambak2019 commented on Nov 19, 2026

    @tryambak2019
    Contributor

    Hi @jtechapps, kindly confirm

    Proposed Milestone 1

    • Run 2–3 Async Processor replicas against Redis and Valkey.
    • Verify no double dispatch or request loss and exactly one terminal record per request.
    • Kill one replica and verify survivor redelivery within the lease TTL.
    • Scale up and down under load.
    • Publish initial support-matrix results for these cases.

    Proposed Later Milestones

    • GCP Pub/Sub, SQL, or deprecated Redis Pub/Sub.
    • Shared/metric gate behavior, fairness, or metric aggregation.
    • Rolling upgrades, node drains, or PDB behavior.
    • Throughput benchmarking.
    • Chart enablement or final documentation.
    • Declaration of general multi-replica support.
  3. jtechapps commented on Nov 19, 2026

    @jtechapps
    CollaboratorAuthor

    deprecated Redis Pub/Sub testing and support is not needed.

  4. jtechapps commented on Nov 19, 2026

    @jtechapps
    CollaboratorAuthor

    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.

  5. tryambak2019 commented on Nov 20, 2026

    @tryambak2019
    Contributor

    @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?

  6. tryambak2019 commented on Nov 25, 2026

    @tryambak2019
    Contributor

    @jtechapps, thank you very much for merging #574.

    kindly confirm the proposed Milestone 2:

    • Run rolling upgrades under load.
    • Drain a node with a PDB (PodDisruptionBudget).
    • Verify no request loss and no stalls beyond the lease TTL.
    • Update the multi-replica guide with what these tests confirm.
  7. jtechapps commented on Nov 25, 2026

    @jtechapps
    CollaboratorAuthor

    LGTM on milestone 2

  8. tryambak2019 commented on Nov 25, 2026

    @tryambak2019
    Contributor

    @jtechapps
    Milestone 2 is ready for your review in PR #593

    It adds:

    • Same-build rolling replacement after all three replicas reach in-flight capacity
    • Node drain in a two-worker Kind cluster, protected by a minAvailable: 2 PDB

    Could you kindly review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions