Performance: recap and quiz
The module in six sentences
Section titled “The module in six sentences”- Latency and throughput. Latency is how long one request takes and throughput is how many a system completes, the time of a request is waiting plus service, and throughput rises with load until it meets a capacity and is then flat.
- Percentiles and tail latency. The mean can describe nobody, p50 is the typical request and p99 is the one in a hundred, and a page that makes many calls meets the tail far more often than one call in a hundred.
- Little’s Law. The number of requests inside a system is the arrival rate times the time each stays, so it sizes pools and shows that concurrency rises when latency rises.
- Utilisation and queueing. Time in a service grows slowly and then sharply as utilisation approaches 100%, more servers sharing a queue flatten the curve, and variable service times steepen it.
- Bottlenecks. The component that reaches its capacity first limits the whole path, it is not necessarily the slowest one, and lifting it reveals the next.
- CPU, memory and I/O. Each resource shows saturation in its own way, and memory is a stock that fails abruptly while CPU, disk and network slow down gradually.
How each one is misunderstood
Section titled “How each one is misunderstood”| Idea | The common mistake | The correction |
|---|---|---|
| Latency | Reading the average and calling it “the latency” | Ask which percentile, and whether failed requests are counted apart |
| Percentiles | Averaging the p99 of several servers | Keep histograms, merge them, and read the percentile at the end |
| Little’s Law | Sizing a pool for the average latency | Size it for the slow case: concurrency is rate times latency |
| Utilisation | Treating 90% as “10% to spare” | At 90% a request takes ten times its service time on one server, and three times on four |
| Bottlenecks | Improving the slowest or the most familiar part | Compute each capacity, and fix the one that is lowest |
| Resources | Watching only CPU | Look at CPU, memory, disk and network, and at saturation as well as utilisation |
A checklist: state it as numbers
Section titled “A checklist: state it as numbers”“It must be fast” cannot be tested. A performance requirement needs a percentile, a load and a margin.
- Which latency? A percentile, not a mean: for example “p99 under 250 ms”. Counted over which requests, and are failed requests counted apart?
- At which load? Requests per second at the peak, and the load it must still hold after growth.
- How much headroom? The utilisation the design runs at peak. With four servers of 20 ms, a p99 goal of 250 ms is met up to 90% and broken at 91%, in the lab’s model.
- What is in flight? The arrival rate times the latency, for every pool, in the slow case as well as the average one.
- What limits it? The capacity of each component on the path, and which is lowest. Which resource is it: CPU, memory, disk or network?
Check what you have learnt
Section titled “Check what you have learnt”Eight questions cover the whole module. Every option is explained, whether it is right or wrong.
Performance: module quiz
This quiz needs JavaScript to check your answers.
What comes next
Section titled “What comes next”The next module, Networking and Edge, looks at the part of latency that no server can remove: the time a request spends travelling. You have already met its floor, the speed of light, in the first module, and the numbers there decide how many round trips a request can afford.
Your progress
Built by GhaziAlibi.
© ShardCraft. All rights reserved.