Postmortem of a Large Language Model Service Outage: High Availability and Rapid Recovery Practices
A recurring outage in an online large language model service exposed gaps beyond the initial failure, including capacity planning, dependency resilience, change management, observability, and recovery validation. This article examines why incidents can recur, how to design monitoring and incident response, and how to improve architecture, deployment practices, postmortems, and user communication. It also includes practical health-check and circuit-breaker examples, along with an operational checklist.
1. Incident Overview
An online large language model service experienced access problems through both its web interface and client applications overnight. The operations team detected the issue at 21:35 and began investigating. Service recovery was declared at 23:23.
However, performance degraded again at approximately 00:20 the following day and did not fully recover until around 10:00, resulting in a cumulative impact of roughly 12 hours.
The short interval between the two incidents indicated that the service was not sufficiently stable after the initial recovery. This pattern often suggests that the problem is not limited to a single failed component. Capacity planning, dependency chains, change management, or emergency procedures may also be involved.
For users, repeated disruptions erode trust more quickly than a single outage. For engineering teams, incidents of this kind provide an opportunity to evaluate observability, release processes, and incident response plans.
2. Why the Failure Recurred
2.1 Service Recovery Does Not Mean Root-Cause Resolution
When service metrics return to normal, it only means that the immediate symptoms have disappeared. If recovery depends on restarting instances, manually rerouting traffic, or temporarily adding capacity while the actual trigger remains unidentified, the problem may return when traffic increases, a scheduled job runs, or another peak period occurs.
2.2 Common Triggers
- Traffic spikes: Hotspot requests or peak traffic exceed the inference cluster’s capacity. Requests begin to queue and timeout rates rise rapidly.
- Dependency instability: Authentication, caching, message queues, or model-loading services experience problems, causing cascading failures.
- Risk introduced by changes: A configuration update, software release, or adjustment to autoscaling policies is not sufficiently validated.
- Resource exhaustion: GPU memory, connection limits, thread pools, or file descriptors are fully consumed, leaving the service technically alive but extremely slow to respond.
Determining which trigger is responsible requires complete monitoring data and a reliable incident timeline, not guesswork based on experience.
3. Incident Detection: Monitoring and Alerting
3.1 Track the Four Golden Signals
The four commonly used indicators of service health are latency, traffic, errors, and saturation.
Latency should distinguish successful requests from failed requests. Otherwise, fast failures may hide genuinely slow successful requests. Saturation indicates how close resources are to their limits and is often the most useful signal for early warning.
3.2 Layered Monitoring and User-Side Probes
Server-side metrics cannot fully represent the user experience. A monitoring strategy should include several layers:
- Access layer: Track connection counts, handshake latency, and access success rates by region.
- Business layer: Break down success rates and latency distributions by API, model version, and tenant.
- Dependency layer: Monitor the availability and response times of authentication, cache, queue, and other dependent components.
- User side: Use scheduled synthetic probes to simulate real request paths and verify availability from outside the service.
The following simple health probe uses only the Python standard library and can serve as a starting point for synthetic monitoring:
import timeimport urllib.requestimport urllib.errordef probe(url: str, timeout: float = 3.0) -> dict:"""Send a probe request and return availability and latency."""start = time.monotonic()try:with urllib.request.urlopen(url, timeout=timeout) as resp:latency = time.monotonic() - startreturn {"ok": resp.status == 200, "latency": latency}except (urllib.error.URLError, TimeoutError) as exc:return {"ok": False, "latency": None, "error": str(exc)}
Probe results should feed into alerting rules. A single failed request should not immediately trigger a major incident. A better approach is to escalate when there are N consecutive failures or when the error rate remains above a threshold for M minutes. This helps reduce false positives.
3.3 Alert Severity Levels
Alerts should be assigned clear severity levels:
- P0: Core functionality is unavailable and requires an immediate response.
- P1: Performance has degraded significantly or a subset of users is affected.
- P2: A trend or anomaly requires attention but does not yet represent a major user impact.
Each level should have a defined response time and an assigned owner.
4. Incident Response Process
An effective incident response can be divided into five stages:
- Detection and confirmation: Verify that the alert is valid, assess the scope of impact, and decide whether to escalate.
- Damage control: Restore user availability first. Common actions include rate limiting, disabling noncritical features, circuit-breaking failed dependencies, and switching traffic to standby nodes.
- Root-cause investigation: Compare the incident timeline with deployment records, traffic curves, and resource metrics.
- Recovery and validation: Do not declare the incident over immediately after service returns. Continue monitoring for at least one complete business cycle and confirm that latency and error rates remain stable.
- Communication: Share progress internally and provide external updates at the agreed frequency.
The key principle during damage control is to protect availability first and address the root cause afterward. The following simplified circuit breaker fails fast when a dependency becomes unstable, preventing threads from being occupied for too long:
import timeclass CircuitBreaker:def __init__(self, failure_threshold: int = 5, reset_timeout: float = 30.0):self.failure_threshold = failure_thresholdself.reset_timeout = reset_timeoutself.failures = 0self.opened_at = Nonedef allow(self) -> bool:if self.opened_at is None:return True# Allow a small number of probe requests after the cooldown period.if time.monotonic() - self.opened_at >= self.reset_timeout:return Truereturn Falsedef record_success(self):self.failures = 0self.opened_at = Nonedef record_failure(self):self.failures += 1if self.failures >= self.failure_threshold:self.opened_at = time.monotonic()
A production-grade circuit breaker also needs to handle half-open states, concurrent probes, and metric reporting. This example shows only the core logic.
5. Building Stability at the Architecture Level
5.1 Capacity Planning and Load Testing
Capacity planning should be based on historical peaks and projected growth, with sufficient redundancy reserved. Load tests should reflect real request distributions, including long prompts, high concurrency, and sudden traffic spikes, rather than testing only average load.
Test results should identify per-instance throughput, resource-utilization inflection points, and the thresholds that trigger scaling.
5.2 Rate Limiting and Queuing
The token bucket algorithm is commonly used for rate limiting. It allows a certain amount of burst traffic while keeping the long-term rate within a configured limit.
Inference services should also separate interactive requests from batch workloads. These traffic classes should use different queues and timeout policies so that batch jobs do not consume resources needed by interactive users.
5.3 Multiple Availability Zones and Disaster Recovery
Critical services should run across multiple availability zones, and cross-zone failover procedures should be tested in advance. These procedures must be exercised regularly; otherwise, missing configuration or inconsistent data may cause the switch to fail during a real incident.
5.4 Canary Releases and Fast Rollbacks
All changes should first be validated on a small percentage of traffic before being expanded gradually. Every release should retain a one-click rollback path and define automatic rollback conditions, such as withdrawing the release when the error rate exceeds the baseline by a specified multiple.
6. Postmortems and Continuous Improvement
The purpose of a postmortem is to improve the system, not to assign personal blame. A complete report should include:
- Timeline: Every key event from the initial anomaly through detection, mitigation, and recovery.
- Impact scope: The affected features, regions, percentage of users, and duration.
- Root-cause analysis: Separate direct causes from deeper causes. For example, “a configuration was changed incorrectly” is a direct cause, while “the change lacked validation” is a deeper cause.
- Action items: Each item should have an owner, deadline, and acceptance criteria.
- Effectiveness metrics: Two common metrics are mean time to detect (MTTD) and mean time to recover (MTTR). Tracking their changes helps determine whether incident response is actually improving.
When an incident occurs twice in a short period, the postmortem should pay particular attention to whether the recovery criteria were too lenient. If no observation period was defined after recovery, or if the monitored indicators were incomplete, the team may close the incident before the problem has truly been eliminated.
7. Communicating with Users
Users primarily want to know when the service will recover, what was affected, and what will be done to prevent a recurrence. Effective communication should follow these principles:
- Publish a status notice promptly. Even before the root cause is known, tell users that the issue is being investigated.
- Share only confirmed information and avoid making unsupported recovery-time promises.
- After recovery, explain the scope of the impact and the planned improvements.
- Maintain a regular update cadence so that users are not left without information for an extended period.
8. Implementation Checklist
- Are golden signals and tiered alerts defined for core services?
- Are scheduled probes available from the user side?
- Do critical dependencies have timeouts, retry limits, and circuit breakers?
- Does the rate-limiting strategy distinguish interactive and batch traffic?
- Do releases support canary deployment, automatic rollback, and one-click reversion?
- Is cross-availability-zone failover tested regularly?
- Does the recovery decision include a sufficiently long observation period?
- Does every incident produce a postmortem with action items and assigned owners?
There is no one-time solution for service reliability. Every incident should be converted into a verifiable improvement. Only then can a team meaningfully reduce the probability and impact of the next outage.
