Skip to content
NEWgpt-6-luna removed from Codex Plus / Codex Pro: switch to gpt-5.6-lunaView pricing
HopBase
← Back to blog

How an LLM API Gateway Survives High Concurrency: Scheduling, Failover, Cache Affinity (2026)

How an LLM API Gateway Survives High Concurrency: Scheduling, Failover, Cache Affinity (2026)

The short answer: high concurrency for LLM APIs is not about how fast a gateway forwards requests. It is three stacked constraints β€” scarce provider quotas (hard RPM/TPM caps), provider-side errors as a routine condition (429s and 5xxs are daily weather, not incidents), and long-lived requests (streams run for tens of seconds, video jobs for minutes). So availability comes from scheduling: redundant capacity, failover that treats errors as scheduling signals, and affinity that preserves cache hits under load. A gateway that merely proxies requests inherits every one of those constraints and passes them straight to your application; a gateway that schedules β€” aggregating capacity across redundant routes, retrying classifiable errors on a different route, and pinning sessions so prompt caches keep hitting β€” absorbs them instead. All three mechanisms can be verified before you sign up β€” a reproducible checklist is at the end.

LLM API concurrency is not classic API concurrency

  • Requests live long. A streamed chat holds a connection for tens of seconds; a video generation job runs for minutes. Capacity is consumed by concurrent in-flight connections, not QPS.
  • Provider quota is the scarce resource. Every model API account has hard RPM/TPM ceilings. No single account survives a production peak; real concurrency comes from aggregated, redundant capacity.
  • Provider-side errors are normal. Rate limits, 5xx flapping, and rush-hour congestion exist on every LLM API. If the gateway does nothing, every caller absorbs them raw.

Classic gateways compete on throughput. LLM gateways compete on scheduling. Judge them by the scheduler.

Redundant groups: where concurrency actually comes from

HopBase schedules by group: one API key maps to a group backed by redundant capacity, so throughput is the sum of the group's capacity, not any single account limit. In practice:

  • split groups by business line or team, so batch jobs never starve interactive traffic;
  • give peak workloads their own group and scale it independently;
  • swap models or routing on the gateway side with zero client code changes.

The same mechanism also cuts cost β€” see group-based routing.

Failover: errors are scheduling signals, not your problem

Most gateways return provider errors as-is and leave retries to the client β€” which amplifies provider instability to every caller. Our approach:

  • provider errors first enter the scheduling verdict: not just 5xx β€” most classifiable 4xx responses also trigger automatic failover to another route;
  • only after retries are exhausted do we replay the original provider response β€” error codes are never swallowed or rewritten into timeouts, so your own backoff logic keeps working;
  • billing follows actual output: a request that fails without producing output is not billed; a request interrupted after output was generated (for example, the client disconnects) is charged for the usage already generated and labelled line by line in the usage export.

Probes and event streams: find problems before users do

  • Resident health probes continuously test every route;
  • each route emits an error/recovery event stream β€” degraded routes are automatically down-weighted or pulled, and return to service after recovery;
  • liveness is judged by direct credentialed A/B tests, not vibes.

Cache affinity: concurrency should not cost you prompt cache

Prompt cache hits require requests to land on the same backend account. Naive load balancing that sprays requests across many accounts drives hit rates toward zero β€” concurrency and cache savings become mutually exclusive by design. The fix is affinity scheduling: a session sticks to one account, the affinity window outlasts the official cache TTL, and scale-out never reshuffles live sessions. Hits pay off twice: discounted cache-read pricing and visibly lower time-to-first-token. Details in our prompt cache guide.

How to verify a gateway under concurrency (reproducible)

  1. Load-test for distribution: fixed task set, temperature 0, N concurrent runs; read TTFT P95/P99, not the mean β€” a fat tail means queueing.
  2. Long-output truncation rate: request long outputs and measure silent mid-stream cutoffs, the worst failure mode there is.
  3. Error passthrough: deliberately trigger rate limits or invalid parameters and compare error codes with official behavior.
  4. Cache hit rate: repeat requests with one long system prompt and watch the cached-read share in usage.
  5. Retest across time windows: peak and off-peak, to catch time-of-day degradation.

Verifying model identity and quality (against swapping and silent nerfs) is a separate method: the fidelity test.

FAQ

How much concurrency does HopBase support?

Capacity is sized per workload β€” batch pipelines, shared development environments, and multi-business peaks are the design targets. Talk to us before onboarding and we will size a group to your load.

Why not just publish an uptime percentage?

A number on a landing page cannot be verified by you. We prefer reproducible verification methods and transparent channel attributes (labelled on our pricing page) that you can test yourself. Contractual service terms are handled with our consultants.

What happens if every route fails?

Redundancy turns single-point failures into partial degradation. In the extreme case, once retries are exhausted, the gateway replays the original provider error β€” no fabricated success, and failures that produced no output are not billed.

Does scaling out hurt cache hit rates?

No. Affinity pins sessions to accounts; scale-out adds capacity for new sessions without reshuffling existing ones.

For enterprise onboarding and concurrency sizing, contact us; integration details in the docs.