Take a customer support assistant with these numbers measured over a four-week window, all taken from application logs:
| Metric | Value | Where it comes from |
|---|
| Total requests | 4,032,000 | gateway access log |
| Average request rate | 1.67 req/s | requests divided by window seconds |
| p95 request rate over 1-minute buckets | 4.0 req/s | 95th percentile of the 1-minute rate |
| Peak request rate (worst minute) | 12.0 req/s | maximum of the 1-minute rate |
| Burst ratio | 3.0 | peak divided by p95 |
| Average input tokens per request | 1,100 | provider usage records |
| Average output tokens per request | 350 | provider usage records |
| Tokens per request | 1,450 | sum of the two |
Now convert the steady part into tokens per minute, because that is the unit most reservations are sold in.
- p95 request rate: 4.0 req/s times 60 = 240 requests per minute
- Tokens at p95: 240 times 1,450 = 348,000 tokens per minute
- Peak: 720 requests per minute, or 1,044,000 tokens per minute
- Average load: 1.67 req/s times 60 times 1,450 = about 145,000 tokens per minute
Assume the smallest reservation unit in your region guarantees 200,000 tokens per minute. The reservation then covers 200,000 of the 348,000 tokens per minute your p95 demands, which is 57 percent of p95. You would buy two units (400,000 tokens per minute), which covers p95 fully with 115 percent headroom. That second unit is not free. It is worth buying only if you can keep total utilization above roughly 60 to 70 percent of 400,000, meaning above about 240,000 to 280,000 tokens per minute on an average day.
Here is the check. Average load is about 145,000 tokens per minute, which is well under the line for two units and just under it for one. That tells you the honest answer for this workload: a two-unit reservation would sit around 36 percent utilized, and a one-unit reservation around 72 percent. One unit is defensible if you accept that about 148,000 tokens per minute of your p95 will spill to on-demand. Two units are defensible only if you expect average traffic to grow by roughly 65 percent.
Put that arithmetic in code rather than a slide, so the next review takes minutes:
def size_reservation(rate_avg, rate_p95, rate_peak, tok_per_req,
unit_tpm, target_utilization=0.65):
p95_tpm = rate_p95 * 60 * tok_per_req
peak_tpm = rate_peak * 60 * tok_per_req
avg_tpm = rate_avg * 60 * tok_per_req
units = max(1, round(p95_tpm / unit_tpm))
guaranteed = units * unit_tpm
return {
"p95_tpm": p95_tpm,
"peak_tpm": peak_tpm,
"units": units,
"guaranteed_tpm": guaranteed,
"p95_utilization": round(p95_tpm / guaranteed, 2),
"avg_utilization": round(avg_tpm / guaranteed, 2),
"clears_target": avg_tpm / guaranteed >= target_utilization,
"burst_ratio": round(rate_peak / rate_p95, 2),
}
print(size_reservation(1.67, 4.0, 12.0, 1450, unit_tpm=200_000))
Run it and read three outputs in order: p95 utilization, average utilization, and whether average clears the target. In the example, average utilization is 0.36 for two units, which fails the target. The function says buy two units by the p95 rule and the utilization check says do not. When they disagree, the utilization check wins, because p95 is a single percentile and a handful of slow minutes can drag it up.
A second scenario makes the rule concrete. Same request shape, but traffic is flat: peak 4.5 req/s, p95 4.0 req/s, burst ratio 1.125, average 3.8 req/s. Average load becomes 3.8 times 60 times 1,450 = 330,600 tokens per minute. Two units guarantee 400,000, so average utilization is 83 percent. That is a clear reserve: flat traffic, high steady utilization, and a tail small enough to absorb on-demand.
The contrast is the insight. The first scenario has higher peak traffic than the second, yet it is the worse reservation candidate. Burst ratio and utilization decide, not peak.