LLM Service Stability: Keeping Business Workloads Reliable During Frequent Outages

    This article explains how to define availability metrics, classify and grade incidents, design client-side fault tolerance, use degradation and multi-path routing, schedule long-running and peak-hour workloads, monitor and alert, and run postmortems so LLM-dependent business workflows remain stable during frequent service failures.

    LLM Service Stability: Keeping Business Workloads Reliable During Frequent Outages

    I. Background: Why Stability Matters More Than Features

    LLM services were initially used mainly for chat and Q&A. Occasional interruptions had limited impact on users, who could simply wait a moment for recovery. As these services are integrated into development workflows and business systems, two changes have occurred in usage scenarios.

    First, call chains have become longer. A single code generation or document analysis task often includes multiple model requests. Any failure can interrupt the entire task, and context that has already been completed may be lost.

    Second, the cost of a failure is strongly correlated with when it occurs. The same ten-plus-minute outage has little impact late at night, but during an afternoon work peak it may stop dozens of people at the same time and disrupt batch processing and scheduled jobs that depend on the service.

    Therefore, evaluating the stability of LLM services cannot rely only on whether they are “available on average.” It must also consider when failures occur, which types of tasks are affected, how long they last, and whether results can be protected from corruption after recovery.

    II. Define “Availability” First: The Metric System

    Many debates stem from different understandings of “availability.” Teams need to align on definitions before discussing improvements.

    2.1 Core Metrics

    • Request success rate: The number of requests that successfully return valid results divided by the total number of requests. The criteria for “success” must be clearly defined, for example, whether it includes empty results returned after a timeout or responses with truncated content.
    • Latency percentiles: Use P50, P95, and P99 to describe response time. Averages hide long-tail problems, and the long tail is exactly what users perceive first as lag.
    • Error distribution: Break down statistics by error code, endpoint, model, and region. When the overall success rate appears normal, a single capability may already be failing across a large area.

    2.2 Availability and Allowed Downtime

    The availability target determines how much unavailability a team can tolerate each month. Based on 30 days, or about 720 hours:

    Availability Target Allowed Unavailability in 30 Days
    99% About 7.2 hours
    99.5% About 3.6 hours
    99.9% About 43.2 minutes
    99.95% About 21.6 minutes

    This table shows that a high overall availability rate does not mean there are no user experience problems. A single 90-minute outage is enough to miss a 99.9% monthly target. Teams should therefore set both an overall target and a peak-hour target, such as “the success rate between 9 a.m. and 6 p.m. on weekdays must not fall below a certain level.”

    2.3 Statistical Caveats

    • The statistical period should be fixed. It is recommended to keep both rolling 30-day and calendar-month views.
    • Outage duration should be based on user perception, starting from the first user error rather than from the internal alert.
    • Partial availability should be marked separately, so that an anomaly in only one sub-feature is neither counted as a full outage nor ignored.

    III. Incident Classification and Grading

    3.1 Classification by Impact

    1. Global outage: All requests fail, and both pages and APIs are unavailable.
    2. Partial function anomaly: A model, endpoint, or region is affected while other capabilities remain normal.
    3. Performance degradation: Requests complete, but latency rises significantly and output becomes slower.
    4. Peripheral function anomaly: Supporting functions such as login, SMS verification codes, or file upload fail. The main service appears normal, but users cannot start working.

    The purpose of classification is to help the response team quickly decide which playbook to activate. For example, partial function anomalies can often be resolved through routing switches, while global outages require public communication and an emergency meeting.

    3.2 Grading Standards

    Teams can refer to common P0 to P3 grading:

    • P0: Core capabilities are fully unavailable and affect a large number of users’ workflows; immediate response is required.
    • P1: Core capabilities are partially unavailable, or significant performance degradation occurs during peak hours; handling is required within a short time.
    • P2: Non-core functions are damaged, workarounds exist, and handling can be scheduled during business hours.
    • P3: Minor anomaly that does not affect main functions and can be added to the regular improvement backlog.

    Grading should be determined jointly by impact scope, impact duration, and time of occurrence. A 30-minute outage at midnight and one during a work peak should have different grades.

    3.3 Common Causes

    • Capacity bottlenecks: Traffic exceeds processing capacity during peak periods, queues build up, and requests eventually time out.
    • Change-induced issues: Configuration adjustments, version releases, and dependency upgrades can all cause incidents, so change windows need separate controls.
    • Dependency component failures: Anomalies in caches, message queues, databases, or authentication services spread along the call chain.
    • Network jitter: Cross-region links or egress bandwidth fluctuations manifest as connection loss and occasional timeouts.
    • Upstream dependency anomalies: Problems occur in the compute resources or external services on which model inference depends.

    IV. Client-Side Fault Tolerance Design

    Server-side stability has an upper limit. Client-side fault tolerance design determines how much impact occasional failures will cause.

    4.1 Layered Timeout Settings

    Connection timeouts and read timeouts should be configured separately. Connection timeouts are usually set shorter to quickly detect network unreachability; read timeouts should account for the time required for a model to generate long text and should therefore be longer. Combining them into one value either kills legitimate long-generation requests or lets failed requests occupy resources for a long time.

    4.2 Retry with Restraint

    Retry is the most common fault tolerance mechanism, and also the easiest one to amplify failures. The following principles should be followed:

    • Retry only requests that are safe to retry. Query requests can usually be retried safely; write requests must use idempotency keys, otherwise duplicate data may be created.
    • Retry only explicit transient errors, such as timeouts, rate limiting, and some 5xx status codes. Retrying parameter errors or authentication failures is meaningless.
    • Use exponential backoff with random jitter to prevent a large number of clients from retrying at the same moment and creating a retry storm.
    • Limit the maximum number of attempts and set an overall deadline to prevent a task from occupying resources indefinitely.

    Example pseudocode:

    1. RETRYABLE_STATUS = {429, 500, 502, 503, 504}
    2. function call_with_retry(send_request, max_attempts = 4, base_delay = 1.0, max_delay = 20.0):
    3. for attempt in 1..max_attempts:
    4. try:
    5. response = send_request(connect_timeout = 3, read_timeout = 60)
    6. if response.status not in RETRYABLE_STATUS:
    7. return response
    8. last_error = "HTTP " + response.status
    9. except connection_error as e:
    10. last_error = e.message
    11. if attempt == max_attempts:
    12. break
    13. # Exponential backoff with full jitter
    14. ceiling = min(max_delay, base_delay * 2^(attempt - 1))
    15. sleep(random_between(0, ceiling))
    16. raise error("Request failed after " + max_attempts + " attempts: " + last_error)

    4.3 Circuit Breaking to Protect Downstream

    When the failure rate of a dependency consistently exceeds a threshold, continuing to send requests only consumes threads and connections and slows down other normal functions. A circuit breaker works as follows:

    1. Closed state: Requests pass normally, and the failure rate is tracked.
    2. Open state: After the failure rate exceeds the threshold, requests are rejected directly and degraded results are returned quickly.
    3. Half-open state: After a cooldown period, a small number of probe requests are allowed. If probing succeeds, the circuit returns to closed; if it fails, the circuit opens again.

    Key circuit breaker parameters include the failure-rate threshold, statistical window, cooldown duration, and number of probe requests. These parameters should be adjusted based on historical incident data rather than fixed by intuition.

    V. Degradation and Multi-Path Strategies

    5.1 Capability Degradation

    When a high-quality model is unavailable, it can be switched to a faster or lower-cost model, but output quality must be evaluated first. A degradation path should meet three conditions:

    • The output format is compatible with downstream parsing logic.
    • The quality difference is acceptable for the business and has been validated with samples.
    • The switch is transparent to the caller and requires no code changes.

    5.2 Multi-Path and Routing

    Architecturally, a unified abstraction layer should isolate business code from specific service interfaces. Business callers invoke capabilities such as “text generation” or “structured extraction,” rather than a fixed address. The abstraction layer selects paths based on health status, latency, and cost, and switches automatically during failures.

    Routing policies are usually delivered by a configuration center and do not require a redeployment when changed. This allows operations staff to complete a switch within minutes during emergencies.

    5.3 Functional Degradation

    Some capabilities cannot be replaced. In such cases, functional degradation can be used:

    • Cache results for common requests and return cached content with a timestamp during service anomalies.
    • Split complex tasks into independently completable substeps, and rerun only the failed step when a failure occurs.
    • Disable non-critical features such as automatic summaries and intelligent recommendations to keep the main flow available.
    • Provide a manual fallback entry so critical workflows can still move forward during long outages.

    VI. Business Scheduling for Long Tasks and Peak Periods

    6.1 Identify Peak Periods

    Use access logs to count hourly request volume and error rates, and identify business peaks. Common peaks include the first half hour of work in the morning, concentrated office hours in the afternoon, and evening code commit and release windows. Scheduling batch tasks, data synchronization, and model evaluations during off-peak periods can significantly reduce the impact of failures on core flows.

    6.2 Make Long Tasks Asynchronous

    Synchronously waiting for long-task results is highly sensitive to network and service status. After switching to asynchronous mode, the flow is as follows:

    1. Return a task ID immediately after submission.
    2. The task queues and executes in the background, and results are written to persistent storage.
    3. The client obtains results through polling or callbacks.
    4. Failed tasks automatically enter a retry queue, and the failure reason is recorded.

    The benefit of asynchronous processing is that even if the service is interrupted for an hour and a half, submitted tasks are not lost and can continue after recovery.

    6.3 Save Intermediate State

    Multi-step tasks should save intermediate results after each step. For example, a document analysis flow can be divided into three steps: “extract key points, generate an outline, write the body.” The result of each step is persisted. After a failure, the task resumes from the most recent completion point instead of starting over.

    6.4 Idempotent Design for Write Operations

    Write requests should carry a unique idempotency key. The server records processed idempotency keys and returns the first result directly for duplicate requests. This allows clients to retry safely after timeouts without creating duplicate tickets, messages, or database records.

    VII. Monitoring and Alerting

    7.1 Synthetic Probes

    Passive monitoring can only detect failures that have already occurred. Synthetic probes periodically send fixed test requests to actively verify critical service paths, including authentication, model calls, structured output, and peripheral functions. Probes should cover major capabilities and be deployed by region so that local and global failures can be distinguished.

    7.2 Multi-Dimensional Monitoring

    Monitoring metrics should be broken down by the following dimensions:

    • Model or endpoint
    • Region or network egress
    • Error code type
    • Client version
    • Business line or tenant

    When overall metrics are normal, dimensional metrics often expose problems early.

    7.3 Alert Noise Reduction

    A single failure should not trigger an alert. Alert conditions can be designed as follows: the error rate exceeds the threshold for three consecutive statistical periods, or P99 latency continuously exceeds the baseline for five minutes. This avoids false positives and provides timely notification before the problem expands.

    7.4 Logging Standards

    Logs should record request identifiers, time, endpoint, status code, latency, and retry count for troubleshooting. Logs should not contain raw user input, access credentials, or personal information. Sensitive fields need to be masked, and reasonable retention periods should be set.

    VIII. Postmortems: Recovery Speed and Stability Should Be Evaluated Separately

    Incident recovery speed and incident frequency are two independent metrics. Mean time to recovery (MTTR) measures emergency response capability, while incident frequency measures the health of the system itself. Looking only at the former can easily lead to the conclusion that “handling was fast, so the problem is not serious.” Frequent incidents, even if each is recovered quickly, will continuously erode user trust and team energy.

    8.1 Postmortem Template

    Every medium-level or higher incident should produce a written postmortem covering:

    • Timeline: A complete record from the first anomaly and alert trigger to human intervention and recovery.
    • Impact scope: Affected functions, number of users, and business loss.
    • Root cause: Distinguish direct causes from underlying causes, and avoid stopping at the surface.
    • Action items: Each improvement must have an owner, completion time, and verification method.
    • Lessons learned: Update monitoring rules, emergency playbooks, and change checklists.

    8.2 Tracking Action Items

    The value of a postmortem depends on whether action items are implemented. It is recommended to include action items in the team’s regular iteration and check completion in the next monthly review. Repeated incidents of the same type usually indicate that the action items did not truly address the root cause.

    IX. Implementation Checklist

    When implementing the above plan, you can check each item against the following checklist: