What you'll learn: how to turn "it must be fast and always on" into a latency budget per hop, a peak concurrency figure, an availability target in downtime minutes, and a rule for when a dependency is down.
At a glance
Figure 1. The request path with a budget on each hop (illustrative seconds, 95th percentile)
How to read this: the two reads run in parallel, so only the slower one counts; 0.2 + 0.8 + 4.0 + 0.3 + 0.2 = 5.5 s, leaving 0.5 s of a 6.0 s target as reserve.
- A target is a number, a percentile and a measurement point.
- Give every hop a budget share and a timeout.
- Little's law gives average concurrency; the ceiling is the number of users.
- A higher availability target can cost far more: choose the lowest the customer can live with.
- Write down what the assistant does when each dependency is down.
Scenario
Composite scenario, not a real company. Lumen Industrial Supply, a fictional distributor, is designing its Order and Policy Assistant for 24 customer-service agents. The Head of Customer Operations says: "It must be fast and always on." The platform team asks what load the order management system (OMS) should expect. All numbers are illustrative.
What you will be able to do
- Split a latency target across hops and set a timeout on each.
- Estimate peak concurrency with Little's law and name the ceiling.
- Convert an availability target into downtime minutes for a stated window.
- Write a degradation rule for each dependency.
Prerequisites
Integrating with the customer's order and policy systems defines the hops; AI Architect: reliability and scaling covers timeouts, retries and fallbacks.
Core ideas
Latency: one budget, one share per hop
Figure 2. Latency budget sheet (Lumen values are illustrative allocations, not measurements)
| Hop | Budget p95 (s) | Timeout (s) | If slow or failing | Measured p95 |
|---|---|---|---|---|
| API gateway | 0.2 | 1.0 | Error to the agent | ____ |
| Retriever (policy search) | 0.5 | 1.0 | Skip the policy part, say so | ____ |
| Tool server (order lookup) | 0.8 | 1.2 | Skip the order part, say so | ____ |
| Model call | 4.0 | 5.0 | Show cited passages only | ____ |
| Guardrail | 0.3 | 0.5 | Block the reply | ____ |
| Reply | 0.2 | 0.5 | Error to the agent | ____ |
| End to end | 6.0 | 6.5 | Honest error | ____ |
How to read this: fill the last column with your own measurements; the model row is likeliest to be wrong, so measure it in Run your service against a real model.
Predict first. At month-end the order system is slow and the lookup takes 3.5 s instead of 0.8 s. Ignoring timeouts for now, which hop breaks the 6.0 s target, and by how much?
Answer
The order lookup. It is now the slower parallel read: 0.2 + 3.5 + 4.0 + 0.3 + 0.2 = 8.2 s, which is 2.2 s over. The model call did not change.
Percentiles of separate hops do not add, so the sum is a plan: measure the end-to-end p95 too. Google's SRE book warns that a 100 ms average can hide "1% of requests" taking "5 seconds".
Capacity: concurrency from usage, then the ceiling
Little's law: the average number in a system, L, equals the average arrival rate, λ, times the average time in the system, W. Little's 2011 retrospective states L = λW and proves a finite-interval form.
Figure 3. Sizing the Lumen assistant (all inputs illustrative)
| Quantity | Formula | Value |
|---|---|---|
| Peak-hour requests | 6,720 / 21 days = 320 a day, x 20 percent, x 3 requests | 192 |
| Arrival rate λ | 192 / 3,600 s | 0.0533 per second |
| Average in flight L | λ x 5.5 s | 0.29 |
| If calls hang to 30 s (no timeout) | λ x 30 s | 1.6 |
| Hard ceiling | 24 agents x 1 request each | 24 |
| Ceiling rate | 24 / 5.5 s | 4.36 per second |
How to read this: the average is tiny, so the real questions are the ceiling and the limits of the systems you call.
Do not size a limit from the average 0.29. With one open request per agent, 24 is the most in flight: ask the platform team whether the gateway and the OMS accept 24 concurrent calls and about 4.4 a second. Read model provider limits from your own account.
Availability: a target, a window and a downtime figure
The SRE book defines a service level indicator (SLI) as "a carefully defined quantitative measure" of service level and a service level objective (SLO) as "a target value or range of values" measured by an SLI. It advises avoiding absolutes such as "always" available.