Access Layer High Availability for LLM Services: Lessons from a Long Outage

    This article explains why access-layer failures hurt LLM services so much and how to trace the full request path, from login to the first streamed token. It shows how to run an incident postmortem with a timeline, impact analysis, and layered root cause analysis. It also covers common root causes, including authentication and session storage jitter, long-connection buildup, scheduling hotspots, and overly strict rate limits, along with design fixes such as circuit breakers, graceful degradation, gradual recovery, and an observability checklist.

    1. Why Access-Layer Failures Are Amplified Easily

    An online LLM service usually has two parts. The first is the inference cluster, which runs the model computation. The second is the access layer, which covers everything between a user opening the page and seeing a reply. The access layer includes the entry gateway, authentication, session persistence, context read and write, long-connection management, regional scheduling, and rate limiting.

    Failures in these two parts look very different. When the inference cluster has problems, the usual symptoms are slower generation, lower reply quality, or one model becoming unavailable. When the access layer has problems, users hit failures immediately: they cannot log in, the page stays blank, messages fail to send, or replies never appear. Even when the model runs normally, users will conclude that the service is down.

    Therefore, when you review an LLM service outage, first determine which layer the affected component belongs to. Only after locating the layer will troubleshooting and repair stay on track.

    2. From Click to Response: Breaking Down the Full Request Path

    When a user sends a message, the request typically passes through the following steps:

    1. The request enters the entry gateway, which handles TLS termination, route matching, and basic validation.
    2. The authentication module verifies the login state and device information, and refreshes the token when necessary.
    3. The session module reads the conversation history based on the session ID and determines which service node currently hosts the session.
    4. The scheduling module selects an inference backend based on region, load, and model version.
    5. The inference result is returned as a stream. A long connection pushes incremental content to the client.
    6. The rate limiting policy constrains request volume and concurrency at each step.

    A problem with any one of these steps can make the whole service look broken to the user. For this reason, access-layer availability cannot be judged by the health of a single service alone. Teams need to measure end-to-end success rate and time to first token.

    3. Postmortem Method: Reconstructing an Incident with Timelines and Impact

    A complete postmortem usually has three parts: a timeline, an impact analysis, and layered root cause analysis.

    3.1 Timeline

    The timeline should record when the anomaly started, when it was confirmed, when service partially recovered, when it degraded again, and when it was finally resolved. The table below is a hypothetical timeline included only to show the recording format:

    Time Event Notes
    Day 1, 21:35 Errors increase on the web and client apps Monitoring shows the login success rate dropping
    Day 1, 23:20 Metrics recover briefly Cause not confirmed; some nodes were temporarily removed from service
    Day 2, 00:20 Performance metrics deteriorate again Time to first token exceeds the threshold, and the alert fires again
    Day 2, 10:30 Recovery confirmed Rollback completed and end-to-end success rate verified

    The brief recovery in the timeline needs close attention. If the team stops work without finding the cause, the failure is likely to return. Recurring failures usually mean that the root cause was not fully removed, or that the system came out of recovery without enough capacity.

    3.2 Impact Scope

    The impact analysis should answer three questions: Which features were unavailable? Which user groups were affected? How long did the problem last? For access-layer failures, the analysis must also distinguish between completely unavailable service and partial request failures. Partial failures are harder to notice, but they can cause steady user churn over time.

    3.3 Layered Root Cause Analysis

    Root cause analysis should rule out each layer in turn instead of jumping to a conclusion. A common layering approach is:

    • Access layer: gateway configuration, certificates, and routing rules.
    • Authentication layer: token verification service, and connection pool and timeout settings for session storage.
    • Session layer: read and write latency for session data, cache invalidation, and node migration.
    • Scheduling layer: regional allocation policy, uneven node load, and hot sessions.
    • Rate limiting layer: whether thresholds are too conservative, and whether they block normal traffic.

    4. Common Root Causes and Matching Design Improvements

    4.1 Authentication and Session Storage Jitter

    The authentication service depends on session storage. When storage response times increase, authentication requests queue up, the connection pool fills, and many requests eventually time out. Improvements include:

    • Setting independent timeouts and retry budgets for authentication calls.
    • Separating read and write traffic for session storage.
    • Caching short-lived token verification results at the gateway layer.

    4.2 Long-Connection Buildup

    Streaming output depends on long connections. If many clients reconnect at once, or the server does not release connections that have already dropped, the connection count can quickly reach its limit. There are three countermeasures:

    • Set an idle connection timeout.
    • Limit the number of concurrent connections per user.
    • Implement exponential backoff for reconnection on the client, so that many clients do not reconnect at the same moment.

    4.3 Regional Scheduling and Hotspots

    If the scheduling policy considers only geographic distance and ignores actual node load, some nodes can stay overloaded for long periods. The scheduling policy should consider latency, queue length, and error rate together. Teams should also check request distribution across nodes on a regular basis.

    4.4 Rate Limiting False Positives

    If rate limit thresholds were set during off-peak hours, they may block legitimate requests during peak hours. Rate limiting should be tiered. Anonymous, logged-in, and paid requests should each have different thresholds, and an emergency switch should be available to relax limits manually.

    4.5 Recurring Failures

    Recurrences usually come from three causes. First, the fix addressed the symptoms but not the root cause. Second, caches were empty during recovery, so backend services received a sudden flood of requests. Third, the degradation was lifted before scaling out was finished. The corresponding practices are: keep an observation period after the fix, reopen traffic gradually, and keep key metrics from the incident period in logs for later comparison.

    5. High Availability Design Example: Circuit Breaking and Degradation

    A circuit breaker stops calls to a downstream service for a period when that service fails repeatedly, giving it time to recover. The following is a simplified circuit breaker example. A production system also needs to handle concurrency safety and metrics reporting.

    1. import time
    2. class CircuitBreaker:
    3. """Simplified circuit breaker: opens after consecutive failures reach the threshold, and enters a half-open state after the timeout."""
    4. def __init__(self, failure_threshold: int = 5, reset_timeout: float = 30.0):
    5. self.failure_threshold = failure_threshold
    6. self.reset_timeout = reset_timeout
    7. self.failures = 0
    8. self.opened_at = None
    9. def allow_request(self) -> bool:
    10. if self.opened_at is None:
    11. return True
    12. # After the breaker opens, let a small number of probe requests through once the wait time has passed
    13. if time.monotonic() - self.opened_at >= self.reset_timeout:
    14. return True
    15. return False
    16. def record_success(self) -> None:
    17. self.failures = 0
    18. self.opened_at = None
    19. def record_failure(self) -> None:
    20. self.failures += 1
    21. if self.failures >= self.failure_threshold:
    22. self.opened_at = time.monotonic()
    23. def handle_chat_request(breaker: CircuitBreaker, call_backend, fallback):
    24. if not breaker.allow_request():
    25. return fallback() # Degradation: return a queuing notice or cached history
    26. try:
    27. result = call_backend()
    28. breaker.record_success()
    29. return result
    30. except Exception:
    31. breaker.record_failure()
    32. return fallback()

    Degradation strategies need to be designed in advance. For example, when the inference backend is unavailable, returning a clear queuing notice is more useful than leaving users to wait with no feedback. Product and engineering teams should agree on the degraded experience together and verify it through drills.

    6. Observability and Alerting

    Access-layer alerts should cover the following metrics:

    • End-to-end success rate, broken down by feature and region.
    • Time to first token at percentiles such as P50, P95, and P99.
    • Login and authentication failure rate.
    • Number of long connections, connection setup time, and the distribution of disconnect reasons.
    • Rate limit trigger counts, separating correct blocks from false positives.
    • Request volume and error rate for each scheduling node.

    Alerts should use both absolute thresholds and trend changes. If metrics deteriorate again shortly after a brief recovery, looking only at current values can make the situation seem to be improving. Teams should set a separate observation alert that checks whether metrics stay stable for a period after recovery.

    7. Operations Checklist

    1. Define a rollback plan before every change, and verify that the rollback can finish within a set time limit.
    2. Release changes with a canary rollout. Open a small share of traffic first, then expand only after core metrics look healthy.
    3. Run capacity drills regularly to verify the headroom of each layer under peak traffic.
    4. Run failure drills regularly, such as simulating session storage timeouts, node removal, and regional failover, to confirm that degradation logic works.
    5. Postmortem reports should include the timeline, impact scope, layered root cause analysis, and improvement items, each with an owner and a deadline.
    6. Define clear exit criteria for the post-recovery observation period. Emergency measures should only be lifted after those criteria are met.

    8. Summary

    Access-layer failures affect many users, are immediately visible to them, and tend to recur. To handle them, break the access path into layers that can be observed independently, reconstruct events with a timeline, locate the root cause with layered analysis, and reduce risk through circuit breaking, degradation, tiered rate limiting, and gradual recovery. If a team builds these practices into its processes and monitoring, it can judge the direction of the next incident faster and shorten recovery time.