Three Outages in One Day: Building High Availability and Stability for LLM Services

    This article uses a real-world scenario in which a large model platform suffered three service disruptions within 24 hours to break down the technical risks behind LLM outages: compute capacity overload (HTTP 529), authentication and session failures, silent failures in long-running jobs, and the trust cost of inconsistent status reporting. It then presents application-side defenses such as tiered request prioritization and degradation, checkpointing and idempotent model calls, exponential backoff with jitter, circuit breakers, and prompt-level resilience, followed by platform-side practices across capacity elasticity, observability, alerting, multi-region disaster recovery, and release management. A field runbook and a practical stability checklist are included to help teams degrade gracefully instead of collapsing when upstream model services become unavailable.

    Three Outages in One Day: Building High Availability and Stability for LLM Services

    Incident recap: On a single day, a large model platform experienced three service disruptions in less than 24 hours. The first lasted nearly three hours and affected the inference API, the web app, a CLI coding assistant, and collaborative workflows. Two shorter disruptions followed at midnight and around 4 a.m., lasting roughly 6 and 8 minutes, concentrated in login, subscription authorization, and session validation. The provider declared service restored after each incident, yet some users still hit errors on settings, usage, and skills pages after the outages ended.

    This is not an isolated fluke. It is a structural problem that inevitably surfaces once AI infrastructure reaches large-scale commercial use. This article names no specific vendor. Instead, it abstracts these incidents into a reusable engineering question: when the core model service you depend on is unavailable, can your business degrade without collapsing?


    1. Dissecting the Failures: Four Technical Risks Behind Three “Sit-Ups”

    Placing the three disruptions side by side reveals two distinct failure domains. That distinction is the starting point for understanding the problem.

    1. Capacity overload (first incident, ~3 hours)

    The signature symptom was 529 Overloaded. Most developers know 429 Too Many Requests: that is rate limiting, meaning “you are sending requests too fast, please queue.” The semantics of 529 are entirely different: the entire backend compute pool is saturated, a system-level overload signal. Using a restaurant analogy, 429 is a server saying “the food is slow,” while 529 is the kitchen catching fire.

    The deeper causes are usually:

    • The elastic limits of inference compute. LLM inference is a long-lived, high-VRAM, compute-intensive workload. Scaling out is nothing like adding machines to a stateless web service: model loading, KV Cache warm-up, and GPU resource scheduling all take time, and cold starts are often measured in minutes, sometimes tens of minutes.
    • Overlapping traffic spikes. Batch jobs, scheduled tasks, and automation scripts frequently fire at the same moment, creating pulse-shaped traffic.
    • No backpressure mechanism. When upstream pressure reaches the gateway layer and nothing relieves it, an avalanche follows.

    2. Authentication and session failures (second and third incidents, ~6–8 minutes each)

    These failures are short and fast but highly damaging: the model may already be serving inference, but users cannot connect. Common root causes include:

    • Brief unavailability of the auth center (token service, session store);
    • Exhaustion of the connection pool between the gateway and the identity service;
    • Frontend resource failures (static asset delivery, config distribution) that leave pages loading while functionality is broken.

    One key insight: an all-green status page does not mean your account works. Availability must be defined end to end, not by the success rate of the inference endpoint alone.

    3. The silent killer: long-running jobs

    The original account mentions a developer whose 9-hour automation pipeline was entirely wasted during the major outage. This kind of loss is the most hidden and the most expensive, because:

    • Long jobs lack a checkpoint mechanism;
    • Retry logic starts “from zero” instead of “from the last checkpoint”;
    • Task state is not persisted, so a crashed process loses everything in memory.

    4. State synchronization and the cost of trust

    The provider declared recovery three times while users confirmed three times that things still failed on their side. That information gap is itself a system risk. For engineering teams, it means you must build observability of your own, independent of the upstream provider’s status reporting.


    2. Application-Side Defenses: Turning an Uncontrollable Upstream into a Designed Dependency

    The core principle is one sentence: never treat the upstream’s high availability as your own.

    2.1 Tiered degradation: define a survival priority for every request

    Not every call deserves a retry. Introduce explicit request tiers:

    1. # Illustrative code: request tiers + degradation policy
    2. PRIORITY = {"critical": 0, "standard": 1, "batch": 2}
    3. async def call_model(prompt, priority="standard", biz_fallback=None):
    4. try:
    5. return await model_client.invoke(prompt, timeout=8.0)
    6. except OverloadedError: # 529
    7. if priority == PRIORITY["critical"]:
    8. # Critical path: fall back to a backup model / region / larger model
    9. return await model_client.invoke_fallback(prompt)
    10. if priority == PRIORITY["batch"]:
    11. return await degrade_queue.put(prompt) # Move to an async queue, process later
    12. return biz_fallback or default_answer # Return a business-level fallback
    13. except RateLimitError: # 429
    14. await asyncio.sleep(backoff_with_jitter())
    15. return await call_model(prompt, priority, biz_fallback)

    Key points:

    • critical path: allow cross-region and cross-model-tier switching, trading consistency for availability;
    • standard path: short timeout, fast failure, user-friendly messaging;
    • batch path: move into a message queue for asynchronous processing, smoothing peaks and filling valleys, with automatic replay once upstream recovers.

    2.2 Idempotency + checkpointing: so a 9-hour job is never wasted

    The right pattern for long jobs is externalized state:

    1. checkpoint = {
    2. "run_id": run_id,
    3. "completed": ["step_1", "step_2", "step_3"], # Successfully finished nodes
    4. "cursor": 3, # Data read position
    5. "artifacts": ["oss://bucket/run/step_2.json"], # Intermediate outputs in object storage
    6. }
    7. def run_pipeline(run_id):
    8. while not done(checkpoint):
    9. step = next_step(checkpoint)
    10. if step in checkpoint["completed"]: # Idempotent skip
    11. continue
    12. result = call_model(step.prompt)
    13. save_artifact(step.name, result) # Persist after each step
    14. checkpoint["completed"].append(step.name) # Atomic update
    15. persist(checkpoint)

    The critical constraint: side effects of every model call must be idempotent, meaning the same input produces the same result on repeated execution and repeated writes create no dirty data. Generate a business idempotency key per call and let the server deduplicate.

    2.3 Retrying the right way: exponential backoff + jitter

    Naive retries are accomplices in avalanches. Engineering practice should follow these rules:

    Principle Practice
    Retry only retryable errors Retry 529/503/timeouts; do not retry 4xx parameter errors
    Exponential backoff 1s → 2s → 4s → 8s, capped at 30s
    Add jitter Avoid a thundering herd retrying simultaneously
    Set a retry budget Cap the global share of retries (e.g., 10%) to prevent retry storms
    1. def backoff_with_jitter(attempt=0, cap=30.0):
    2. base = min(cap, 2 ** attempt)
    3. return random.uniform(0, base) # full jitter

    2.4 Circuit breaker: protect yourself proactively

    When the upstream error rate crosses a threshold, trip the breaker immediately. Subsequent requests go straight to the degradation path instead of consuming threads and connections for nothing. In the half-open state, let a small number of probe requests through to test recovery and avoid repeated flapping.

    1. class CircuitBreaker:
    2. def __init__(self, fail_threshold=20, reset_timeout=30):
    3. self.fail_threshold = fail_threshold
    4. self.reset_timeout = reset_timeout
    5. self.state = "closed"; self.fails = 0; self.opened_at = 0
    6. def allow(self):
    7. if self.state == "closed": return True
    8. if time.time() - self.opened_at > self.reset_timeout:
    9. self.state = "half-open"; return True # Probe request
    10. return False
    11. def record(self, ok):
    12. if self.state == "half-open":
    13. self.state = "closed" if ok else "open"
    14. self.fails = 0
    15. return
    16. self.fails = 0 if ok else self.fails + 1
    17. if self.fails >= self.fail_threshold:
    18. self.state = "open"; self.opened_at = time.time()

    2.5 Resilience at the prompt layer

    • Version your prompts: switch prompt templates during an incident without code changes, and validate alternatives quickly;
    • Small-model fallback: switch to a smaller model when the primary is unavailable, keeping the path “usable but degraded”;
    • Cache first: route high-frequency repeated requests through semantic or result caches, cutting both cost and dependency;
    • Streaming output: SSE/streaming responses let users see that generation is underway, converting timeout anxiety into a sense of progress.

    3. Platform-Side Engineering: Keeping Red Lights from Becoming Routine

    Teams that self-host or operate managed model services can harden along five dimensions.

    1. Capacity and elasticity

    • Establish an inference load-test baseline that defines QPS and P99 latency ceilings per GPU or per instance;
    • Adopt queues plus asynchronous scheduling, using a message queue to absorb pulse traffic so requests never hit the inference layer directly;
    • Reserve elastic buffer capacity (typically 20%–30% headroom) to cover spikes and overlapping scale-out windows;
    • Optimize cold starts: warm model weights, keep a pool of always-on instances, use priority-preemptive scheduling.

    2. The observability trio

    • Metrics: QPS, error rate, time to first token (TTFT), time per output token (TPOT), GPU utilization, VRAM usage, queue length;
    • Tracing: full-chain tracing to determine whether the slowdown is in the gateway, the queue, or inference;
    • Logs: structured logs, with sensitive content masked before shipping to the logging service.

    Define key metrics from the user’s perspective: make “end-to-end success rate of a user completing a task” the core SLO, rather than the proportion of 200 responses from the API.

    3. Alert design

    • Every alert must be actionable, bound to a clear runbook;
    • Tier them: P0 (full outage), P1 (partial capability or partial region impaired), P2 (performance degradation);
    • Use alert convergence to avoid storms: aggregate similar alerts and suppress derived downstream alerts.

    4. Multi-active deployment and disaster recovery

    • Deploy across regions, with the gateway routing by health;
    • Externalize critical configuration, session data, and task state to highly available storage/cache services to make processes stateless;
    • Drill failover regularly: disaster recovery that has never been exercised is not disaster recovery.

    5. Change and release management

    • Canary releases plus automatic rollback;
    • Schedule change windows away from capacity peaks;
    • Establish a change-to-incident correlation review process.

    4. An Incident Playbook for Users of Upstream Services

    When the upstream turns red again, frontline teams can act in this order:

    1. Confirm the blast radius immediately: is it a global outage, or limited to login, a specific model, or a specific region;
    2. Stop futile retries: pause batch and scheduled jobs to avoid loading the upstream further and wasting quota;
    3. Switch traffic and degrade: open backup channels (backup region, backup model, cached responses, manual fallback);
    4. Protect critical paths: identify core business flows (such as live customer support or order summarization) and prioritize them;
    5. Be transparent with users: state clearly what happened, what you did, when recovery is expected, and what users can do, reducing support load;
    6. Verify after recovery: reconcile checkpointed jobs, inspect backlogged messages, validate data consistency;
    7. Run a postmortem: fill observability gaps, correct SLOs, update runbooks.

    5. Stability Checklist (Ready to Apply)

    Client/integration side

    • Client timeouts, retries, backoff, and jitter are all configurable
    • 429 and 529 are handled separately, with 529 routed directly to the degradation branch
    • Global retry budget and rate limiting (token bucket) as double insurance
    • Circuit breaker in place with half-open probing

    Business side

    • Long jobs support checkpoints and resume-from-checkpoint
    • All model calls are idempotent and carry an idempotency key
    • Intermediate artifacts land in object storage, not memory
    • Async queue fallback with replay of backlogs

    Platform side

    • End-to-end SLO defined as “user task completion rate”
    • Load testing is routine, headroom ≥ 20%
    • Alerts are actionable, convergent, and backed by runbooks
    • Multi-region DR plus quarterly failover drills
    • Canary release plus one-click rollback

    Closing Thoughts

    As LLM services enter a phase of becoming “electrified,” their availability becomes the ceiling for every application above them. What we control is not whether the upstream fluctuates, but how hard the fluctuation hits our own systems.

    Real architectural maturity shows up in three things when an incident occurs: whether you know immediately (observability), whether something catches it automatically (degradation and circuit breaking), and whether the loss is quantifiable and recoverable (idempotency and checkpoints).

    Do one small thing today: add a circuit breaker to your critical path and a checkpoint to your long-running job. Those two changes are often the entire difference between “everything is down” and “it is just a bit slower.”