Notes
Percentiles
Sort every response time from fastest to slowest. The fiftieth percentile, or median, is the middle: half are faster. The ninety fifth percentile means ninety five percent were this fast or faster, and one in twenty was slower. The ninety ninth means one in a hundred was slower. These matter because one page view makes many requests, so almost every user meets the slow tail at some point.
- sort all response times
- p50 (median): half are faster
- p95: 95% are faster; 1 in 20 is slower
- p99: 1 in 100 is slower
- max: one single worst request
- a user makes many requests, so they WILL hit the p99
Averages hide
Here is our two hundred user stress run on ShopRung. The average was thirty five milliseconds, and the median was about the same. But the ninety fifth percentile was fifty seven, the ninety ninth sixty six, one request in a thousand took a hundred and ninety, and the slowest took three hundred and ten. An average of thirty five hides all of that. Report percentiles, and set goals on them.
average 35 ms p50 36 ms p95 57 ms p99 66 ms p99.9 190 ms max 310 ms the average says 35; 1 request in 1,000 took 5x that
Throughput, errors
Throughput is how much work completes per second: requests per second, or business transactions like orders per second. Error rate is failed requests divided by all requests. A failure is not only a five hundred error or a timeout; a two hundred response with an empty product list under load is also a failure, so load scripts should check the body too. Fast answers that are wrong are not success.
- throughput: requests (or transactions) per second that completed
- error rate: failed requests ÷ all requests
- a failure: 5xx, timeout, OR a wrong answer (check the body, not just status)
Little's law
Little's law links the numbers: the number of users equals throughput times the time each request cycle takes, response time plus think time. Our fifty user run had an average think time of two seconds and responses of about two milliseconds, so it predicts fifty divided by about two, roughly twenty five requests per second. Locust measured twenty four point three. Use this to size tests and to spot results that cannot be right.
users = throughput x (response time + think time) 50 users, think 1-3 s (avg 2 s), response ~2 ms predicted: 50 / 2.002 ≈ 25 requests per second measured: 24.3 per second
Server side
Client side numbers say what users feel; server side numbers say why. Watch CPU on every server, memory and garbage collection pauses, the database's slow queries, connection counts and locks, thread and connection pools, which create queues when full, and message queue lengths. Watch the load generators too. When response time rises, find the resource that is saturated first: that is the bottleneck.
- CPU per server, and steal
- memory, garbage collection
- DB: slow queries, connections, locks
- pools: thread and connection pools full → queueing
- queues and their length
- the load generators too
Goals
Numbers need goals. An SLI, a service level indicator, is what you measure, like the ninety fifth percentile of checkout. An SLO, the objective, is the target: under eight hundred milliseconds, errors under one percent, at two hundred requests per second. Put these in the test as thresholds that fail the run, so CI can gate on them. Some teams also use Apdex, one score for how satisfied users are with response times.
- SLI: what you measure (p95 of checkout)
- SLO: the target (p95 < 800 ms, errors < 1%, at 200 req/s)
- in the test: thresholds that fail the run (k6, JMeter assertions, Locust checks)
- Apdex: one satisfaction score
Compare runs
A single number means little; a comparison means a lot. Save every run's results and compare against a baseline from the same script, data and environment. Did the ninety fifth percentile grow by twenty percent? Did throughput drop? Look at graphs over time, not only totals, because warm up and short spikes disappear in averages. And repeat a run before drawing conclusions; results vary from run to run.
- save each run's results
- same script, data, environment
- compare with the baseline: p95 +20%? throughput -10%?
- look at time series, not just totals (warm-up, spikes)
- one run is a sample: repeat before you conclude
Common mistakes
Metric mistakes. Reporting only averages. Averaging percentiles from several servers, which is mathematically wrong; combine the raw data instead. Counting every two hundred as success without checking the body. Including warm up in the totals. Collecting no server metrics, so nobody can explain the result. And drawing big conclusions from a single run.
- averages only
- averaging percentiles across servers (not valid)
- 200 OK counted as success without checking the body
- including warm-up in totals
- no server metrics
- one run, big conclusions
Say it like this
In the interview: I report median, ninety fifth and ninety ninth percentile response times per transaction, never just the average, along with throughput and error rate, where errors include wrong answers. Server CPU, memory, database and pool metrics explain the results. Goals are SLOs written as test thresholds, every run is compared with a baseline, and Little's law sanity checks the numbers.
- "p50, p95 and p99 response
- times per transaction, never
- just the average; throughput;
- error rate including wrong
- answers; and server CPU, memory, DB and pools to explain
- them. Goals as SLOs and test
- thresholds, results compared
- with a baseline, and Little's
- law to sanity-check numbers."