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

Lesson 15 / Unit 4: Load Testing

Concurrency and CPS

Months of load tests at 150 to 600 concurrent calls, and nobody could say what our calls-per-second ceiling was. Why the two numbers stress different layers.

Every load test on the project held a target concurrency: 150, 300, 500, 600. Months of runs, tens of thousands of calls, a capacity model fitted to per-node measurements.

Then someone asked what our calls-per-second (CPS) ceiling was. We did not know, and none of the runs could tell us.

Traffic Relationship

For a stable workload, average active calls equal the answered-call rate times average connected duration. This is a steady-state relationship, not an instantaneous burst formula:

average active calls = answered calls per second x average connected duration

This is Little’s law applied to calls, and it hides a gap. Our harness derived the arrival rate from the concurrency and hold time we asked for. Rate was never a dial.

That is good design for repeatable capacity runs, and it meant we had covered a range of rates only by accident: 0.33 CPS on the soak up to 2.0 CPS on the burst. What we had never done is hold concurrency flat and push the rate up, which helps isolate setup pressure.

Same concurrency. Different setup load.

Average active calls500

1.67 answered calls / second

500 active calls ÷ 300 seconds average duration.

Steady-state arithmetic, not a LiveKit capacity benchmark. Offered calls, burst arrivals and setup time need separate measurements.

Capacity Axes

Calls per second stresses setup: signalling, transaction state, room creation, agent dispatch, worker pool spawn. Concurrency stresses carrying: media relay, ports, bandwidth, steady CPU.

The same concurrency figure can hide a tenfold difference in setup load:

ConcurrencyAverage call lengthRequired CPS
5005 minutes1.67
50030 seconds16.7

Identical media load. Ten times the setup work. A fleet that holds 500 five-minute calls comfortably has told you nothing about 500 thirty-second calls.

A concurrency test loads the right-hand column and says little about the left. Worker pool spawn is marked because that is where our rate failure hid.

Setup Bottlenecks

The agent tier failed at 50 concurrent calls, and the failure was not media. The generator timed out waiting for the answer, because the worker pool was spawning processes and could not do it fast enough.

It was an arrival-rate failure wearing a concurrency costume. We found it only because a ramp happened to push the rate up alongside the concurrency. Read as a concurrency result, “fails at 50” would have sent us looking at ports and memory, where the per-call slopes said there was plenty of room.

Worker pool spawn is a setup cost. The Python agents framework keeps some processes warm ahead of demand, controlled by num_idle_processes (see the server options docs), which is one of the first knobs to look at when setup is what times out.

CPS Experiment

Hold concurrency flat and raise the arrival rate in steps. To keep concurrency constant, shorten the hold time as the rate goes up, so rate times duration stays the same.

Here is an example step plan for 500 concurrent. The first and last rows are the two cases above; the middle rows are filled in with the same arithmetic:

StepTarget CPSHold time per callConcurrency
11.67300 s (5 minutes)500
25100 s500
31050 s500
416.730 s500

Hold each step long enough to reach steady state before moving on, and watch the setup side while you do: time from INVITE to answer, answer timeouts, dispatch latency and worker spawn. The step where setup starts to fail is your CPS ceiling at 500 concurrent. Keep the audio duty cycle and model behaviour comparable. Shorter calls can change greeting frequency and speech activity, so inspect those before attributing a change solely to setup.

The rig itself (real calls, per-call RTP counts, a fleet-side collector) is the one from how to load test a voice agent. Both axes then feed the capacity model, which keeps setup and carrying as separate columns.

When you report capacity

State both numbers whenever you state capacity, and say which one you varied. 500 concurrent is one point on a two-dimensional surface, and on its own it says nothing about arrival rate. If you have only measured one axis, say so. The number is still useful; it is just not the number somebody should plan an arrival-rate ceiling from.

Next: per-call resource accounting, the method that turns a load test’s raw rows into slopes you can size from.

Common questions

What is the difference between concurrency and calls per second?

Concurrency is how many calls are up at once; calls per second (CPS) is how fast new calls arrive. Concurrency stresses carrying (media relay, ports, bandwidth, steady CPU) and CPS stresses setup (signalling, room creation, agent dispatch, worker pool spawn).

How do you calculate calls per second from concurrency?

Divide concurrency by the average call duration in seconds. 500 concurrent calls of 5 minutes need 1.67 CPS; 500 concurrent calls of 30 seconds need 16.7 CPS, ten times the setup work for the same media load.

How do you load test calls per second?

Hold concurrency flat and push the arrival rate up in steps, shortening the hold time so that rate times duration stays constant. The step where call setup starts timing out is your CPS ceiling at that concurrency.

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