Free How much of your firm runs on you? Take the 2-minute Key Man Score.
Lesson reading
0%

Lesson 17 / Unit 4: Load Testing

Time Bucketing

83 of 400 calls failed and the chart showed a capacity hump. Grouped by start time, it was a warm-up decay, and the fix cost nothing. Same data, other clock.

A run at 75 concurrent failed 83 of 400 calls. We bucketed the failures by minute and read the shape: low at the start, rising through the middle, falling at the end. A hump. A hump in the middle of a flat-rate run means the system got overwhelmed and recovered. That is a capacity story, and we wrote it up as one.

It was wrong, and the error was in the timestamp we grouped by.

The numbers below are saved case-study results. The original raw run bundle is not included here, and this review did not rerun the fleet experiment.

Event Timestamps

A call that fails has a start time and an end time, and they can be minutes apart. We bucketed by the minute each call ended. Calls lasted about two minutes, so every failure was recorded two minutes after the condition that caused it.

That shift is enough to move a peak. Failures caused by conditions early in the run land in the middle of the chart. The first minutes look quiet because few calls have ended yet. By the last minutes, the calls ending were started after the trouble had passed. What you get is a hump built out of a lag.

Start Cohorts

Grouped by the minute each call started, the same 83 failures look like this:

MinuteCalls startedFailed
09:0791
09:083014
09:093017
09:103017
09:113015
09:123012
09:13305
09:14300
09:15320

Most complete minutes in this excerpt offered 30 calls; boundary buckets differ. Read down the right-hand column: failures rise initially, then decline to zero. That supports a warm-up hypothesis; it does not prove the cause without a controlled rerun.

Compare offered rate, achieved concurrency, call duration and readiness between runs. Those controls matter more than the shape of one curve; lower load in a passing rerun would not, by itself, rule out capacity.

Warm-Up Hypothesis

The difference matters because each reading prescribes a different action.

  • “Ran out of capacity” means buy more machines.
  • “Warming up” means pre-warm the pool before traffic arrives, which uses idle compute and memory.

Pre-warming was the actual fix. A rerun at identical settings completed 400 of 400.

The end-time chart would have sent someone shopping for hardware they did not need. The start-time chart pointed at pool readiness rather than immediate fleet expansion.

If the pool in question is a LiveKit agent worker pool, the framework already runs each job in its own process and can keep processes warm ahead of demand: a prewarm function loads slow assets before any job is assigned, and num_idle_processes controls how many warm processes wait. Both are documented under server options. The rate side of the same problem, where the pool cannot spawn fast enough, is the subject of concurrency vs calls per second.

Attribution Windows

Bucket by the timestamp of the event you are attributing, not the timestamp you happen to have. Use start cohorts for setup failures. For mid-call loss or stalls, use the actual failure timestamp and contemporaneous load. The end time is useful for completion and teardown questions.

Most load tools and call records hand you the end time first, because that is when the record is written. Check which one your report uses before you read any shape into it.

If your call records sit in a pandas DataFrame with a started_at timestamp and a boolean failed column, the fix is one line: floor the start timestamp to the minute (pandas Series.dt.floor) and group on that.

by_start = calls.groupby(calls["started_at"].dt.floor("min"))["failed"].agg(["count", "sum"])

The gap between the two clocks is the call duration, and at a fixed arrival rate longer calls also mean more of them in flight at once (Little’s law again, the same relation behind concurrency versus calls per second). The longer your calls, the further an end-time chart drifts from the moment that caused it.

Check your own reports

  1. Find the timestamp your failure chart groups by. If it is an end, hangup, or completion time, re-bucket by start time.
  2. Plot offered load (calls started per minute) on the same axis. A shape in failures means little until you know the load was flat.
  3. If failures decay under flat load, rerun with the pool pre-warmed before concluding anything about capacity.

Our reporting misled us in other ways too. When your own report lies covers three more defects, all of them in derivations over correct data. The raw call records here were never wrong either. For the per-call counting habit that made the 83 countable in the first place, see per-call resource accounting.

Common questions

Should load test failures be grouped by start time or end time?

By the timestamp of the event you are trying to explain. For calls and other work with duration, that is usually the start time, because it is when the system was under the conditions that caused the failure. The end time is only when you found out.

How do you tell a warm-up problem from a capacity problem in a load test?

Hold offered load flat and look at failures by start minute. A failure rate that decays to zero under constant load points to warm-up. A rate that rises with load and stays up points to capacity. A rerun at identical settings after pre-warming is the confirming test.

We do this work for teams shipping voice agents: Self-Hosted Voice Agent .

Edit this lesson on GitHub ↗

Discussion

Questions, corrections and war stories welcome. Sign in with GitHub to comment.

Free guide

Be The 10x Entrepreneur

Get the firm out of your head.

  • 8 chapters
  • 7 worksheets
  • 30 day plan