Troubleshooting LLM Service Outages and High-Availability Disaster Recovery Practices

    User-reported "crashes" of LLM services can stem from very different root causes: network issues, gateway throttling, overloaded inference clusters, model version switches, or misconfigured releases. This article classifies LLM service anomalies into three types—availability failures, performance degradation, and quality degradation—and explains how to build an observability metrics system, follow a structured troubleshooting workflow, set up quality regression probes, and implement circuit breakers, fallback strategies, and safe retry policies to achieve high availability and disaster recovery.

    1. Background: Why “Suspected Crashes” Are Hard to Diagnose

    Recently, many users have reported that certain LLM services respond slowly, fail requests, or leave pages unresponsive—some simply call it a “crash.” For application teams that depend on model capabilities, this kind of user perception can correspond to many completely different technical causes.

    What users typically see includes: pages failing to load, messages going unanswered for long periods, streaming output breaking midway, truncated responses, or noticeably worse answers. Behind these symptoms could be network path issues, gateway rate limiting, an overloaded inference cluster, a model version switch, or a configuration error introduced by a recent deployment.

    Therefore, the first thing a team must do when facing such incidents is convert “the anomaly users feel” into “an anomaly the system can measure.” Only by clearly identifying the failure type can the team decide whether to roll back, scale out, degrade, or wait for an upstream dependency to recover.

    2. Three Types of Anomalies

    Based on how they affect the business, LLM service anomalies fall into three categories.

    1. Availability failures: requests cannot return results, manifesting as connection failures, timeouts, or 5xx errors. These are the easiest to detect and demand the fastest response.

    2. Performance degradation: requests complete, but time-to-first-token rises significantly or generation throughput drops sharply. Users feel the service is “laggy” but may not see any error.

    3. Quality degradation: requests return normally, but the output deviates from expectations—for example, weaker instruction following, more formatting errors, or looser logic in long-form text. This type is the hardest to notice because all API status indicators look normal.

    Each category requires different monitoring. Availability failures can be caught with error rates and health checks, performance degradation requires latency percentiles, and quality degradation requires continuous comparison against a fixed evaluation set.

    3. The Observability Metrics System

    Before building monitoring, the team should define a set of core metrics. The table below lists common metrics and their purposes.

    Metric Meaning Anomaly Signal
    Request success rate Percentage of requests returning valid results Sharp drop within a short window
    Time to first token (P95) Time from sending a request to receiving the first token Persistently above the historical baseline
    Generation throughput Tokens output per unit of time Significantly below baseline
    Error code distribution Share of each error code type Sudden spike in one category
    Queue wait time How long requests wait in the scheduling queue Steady growth, indicating insufficient capacity
    Probe quality pass rate Proportion of fixed probes whose output passes the rules Declining over consecutive rounds

    Metric collection should cover three layers: the client, the gateway, and the inference backend. Looking only at server-side metrics will miss network path failures; looking only at client-side metrics makes it impossible to tell which layer is at fault.

    In addition, logs should record the request identifier, model version, routing node, and error details, and these fields must be linkable. This allows the team to quickly reconstruct the full path of a specific failure after the fact.

    4. The Troubleshooting Workflow

    After receiving an anomaly alert, follow a fixed troubleshooting sequence instead of guessing in multiple directions at once.

    Step 1: Confirm the blast radius. Check whether errors affect only specific regions, specific client versions, or specific account types. If only some users are affected, the problem often lies in routing or canary release configuration.

    Step 2: Isolate the layer. Send the same request through different network egresses. If all egresses fail, the problem is most likely server-side; if only one egress fails, the problem may be in the local network or the carrier’s link.

    Step 3: Review recent changes. Check deployment records, model version switches, and configuration changes from the last 24 hours. A large share of incidents stems from changes, not hardware or external factors.

    Step 4: Examine resource metrics. Look at GPU memory usage on inference nodes, batching queue length, and GPU utilization. A continuously growing queue usually means insufficient capacity and calls for throttling or scaling out.

    Step 5: Verify output quality. If the API is available but users report worse answers, run the fixed probes and compare results against the historical baseline to determine whether model behavior has changed.

    Once the root cause is located, record the conclusion, timeline, and remediation actions as the basis for a later postmortem.

    5. Quality Regression Probing

    Availability metrics cannot reflect changes in output quality, so a separate regression probing mechanism is needed. The core approach is to maintain a fixed set of prompts covering the main business scenarios, send them on a schedule, and check the responses with rules.

    Keep the following points in mind when designing probes:

    • Prompts should cover different capability categories—writing, code, reasoning, format compliance—rather than testing a single ability.
    • Check rules should be as objective as possible, such as a minimum character count, the presence of key elements, or structural completeness.
    • Compare each round of probe results against the historical baseline, focusing on trends rather than single-run fluctuations.
    • Use the same probe set before and after a model upgrade, because capability gains on some tasks may come with regressions on others.

    The example below uses only the standard library to send requests and implement simple rule checks. The endpoint and key are placeholders; replace them with your team’s own gateway in practice.

    1. import json
    2. import os
    3. import time
    4. import urllib.error
    5. import urllib.request
    6. GATEWAY_URL = "https://gateway.example-internal/v1/chat"
    7. API_KEY = os.environ["LLM_API_KEY"]
    8. PROBES = [
    9. {
    10. "prompt": "Please explain in at least 200 characters what causes cache breakdown and how to mitigate it.",
    11. "must_contain": ["cache", "breakdown"],
    12. "min_chars": 200,
    13. },
    14. {
    15. "prompt": "Write a Python function that checks whether a string is a palindrome.",
    16. "must_contain": ["def"],
    17. "min_chars": 40,
    18. },
    19. ]
    20. def call_model(prompt: str, timeout: float = 30.0) -> dict:
    21. payload = json.dumps({
    22. "messages": [{"role": "user", "content": prompt}],
    23. "stream": False,
    24. }).encode("utf-8")
    25. req = urllib.request.Request(
    26. GATEWAY_URL,
    27. data=payload,
    28. headers={
    29. "Content-Type": "application/json",
    30. "Authorization": f"Bearer {API_KEY}",
    31. },
    32. method="POST",
    33. )
    34. start = time.monotonic()
    35. try:
    36. with urllib.request.urlopen(req, timeout=timeout) as resp:
    37. body = json.loads(resp.read().decode("utf-8"))
    38. text = body["choices"][0]["message"]["content"]
    39. return {"ok": True, "latency": time.monotonic() - start, "text": text}
    40. except (urllib.error.URLError, TimeoutError, KeyError, ValueError) as exc:
    41. return {"ok": False, "latency": time.monotonic() - start,
    42. "text": "", "error": str(exc)}
    43. def check_quality(result: dict, rule: dict) -> bool:
    44. if not result["ok"]:
    45. return False
    46. text = result["text"]
    47. if len(text) < rule["min_chars"]:
    48. return False
    49. return all(keyword in text for keyword in rule["must_contain"])
    50. def run_probe_round() -> list:
    51. report = []
    52. for rule in PROBES:
    53. result = call_model(rule["prompt"])
    54. report.append({
    55. "probe": rule["prompt"][:20],
    56. "available": result["ok"],
    57. "latency_s": round(result["latency"], 2),
    58. "quality_pass": check_quality(result, rule),
    59. })
    60. return report

    Rule checks can only catch obvious problems such as truncation, missing key structures, or overly short content. Deeper quality evaluation requires manual spot checks or dedicated evaluation methods, and the two should be used together.

    6. Circuit Breaking, Degradation, and Disaster Recovery

    When the backend keeps failing, continuing to forward requests only worsens the failure and makes users wait longer. A circuit breaker can fail fast while the backend is unhealthy and redirect traffic to a fallback plan.

    Common degradation strategies include:

    1. Switch to a backup route: forward requests to equivalent service instances or regional nodes.
    2. Use a lighter model: when the primary model is unavailable, fall back to a less capable but more stable model, and inform the user in the interface.
    3. Return cached results: for highly repetitive questions, return previously verified answers.
    4. Queue and throttle: limit concurrency during peak periods, place excess requests in a queue, and communicate the expected wait time.
    5. Static fallback messaging: when every path is unavailable, show a clear status message instead of a blank page.

    The example below implements a basic circuit breaker and call logic with fallback.

    1. import time
    2. class CircuitBreaker:
    3. def __init__(self, failure_threshold: int = 5, reset_timeout: float = 30.0):
    4. self.failure_threshold = failure_threshold
    5. self.reset_timeout = reset_timeout
    6. self.failures = 0
    7. self.opened_at = None
    8. def allow_request(self) -> bool:
    9. if self.opened_at is None:
    10. return True
    11. # After the breaker opens, allow one trial request through once the cooldown elapses
    12. return time.monotonic() - self.opened_at >= self.reset_timeout
    13. def record_success(self) -> None:
    14. self.failures = 0
    15. self.opened_at = None
    16. def record_failure(self) -> None:
    17. self.failures += 1
    18. if self.failures >= self.failure_threshold:
    19. self.opened_at = time.monotonic()
    20. def answer_with_fallback(prompt, primary, fallback, breaker: CircuitBreaker) -> dict:
    21. if breaker.allow_request():
    22. result = primary(prompt)
    23. if result["ok"]:
    24. breaker.record_success()
    25. return result
    26. breaker.record_failure()
    27. return fallback(prompt)

    Note that the example breaker does not handle the half-open state under concurrency. In production, typically only one trial request is allowed through while all other requests go straight to the fallback path.

    7. Retry Strategy

    Network jitter and brief overloads can often be resolved by retrying. But a poorly designed retry strategy can amplify a failure, so several principles must be followed.

    • Use exponential backoff so the wait time multiplies with each attempt, preventing all clients from retrying at the same moment.
    • Add random jitter to the backoff interval to spread out the timing of retry requests.
    • Set a maximum retry count; once exceeded, go directly into the degradation logic.
    • Only retry errors that are actually retryable.