Skip to content

Performance: recap and quiz

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
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

“It must be fast” cannot be tested. A performance requirement needs a percentile, a load and a margin.

  1. Which latency? A percentile, not a mean: for example “p99 under 250 ms”. Counted over which requests, and are failed requests counted apart?
  2. At which load? Requests per second at the peak, and the load it must still hold after growth.
  3. 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.
  4. What is in flight? The arrival rate times the latency, for every pool, in the slow case as well as the average one.
  5. What limits it? The capacity of each component on the path, and which is lowest. Which resource is it: CPU, memory, disk or network?

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.

Question 1 of 8

A service handles 800 requests per second, and each request takes 50 ms on average from arriving to leaving.

On average, how many requests are in the service at once?

Enter a number and choose its unit.

requests
Question 2 of 8

A dashboard shows a mean latency of 80 ms and a 99th percentile of 1.2 seconds.

What does it tell you?

Choose one answer.

Question 3 of 8

Ten servers each report their own 99th-percentile latency to the monitoring system.

How should the fleet's 99th percentile be computed?

Choose one answer.

Question 4 of 8

One server takes 10 ms to serve a request, with exponentially distributed service times. Requests arrive at random, at 90% of what it can serve.

What is the mean time a request spends in the system?

Enter a number and choose its unit.

milliseconds
Question 5 of 8

A request passes through three components. A has 100 slots and takes 120 ms per request. B has 10 slots and takes 80 ms. C has 20 slots and takes 6 ms.

Which one limits throughput, and at about what rate?

Choose one answer.

Question 6 of 8

A service returns 250 KB responses over a 1 Gbit/s link. Its CPUs are nearly idle.

At most, how many responses per second can it send?

Enter a number and choose its unit.

responses per second
Question 7 of 8

Four servers of 20 ms share one queue. A team considers running them at 95% utilisation instead of 70%.

Which statements are correct?

Choose every answer that applies.

Question 8 of 8

Which resource tends to fail abruptly at its limit, instead of slowing down gradually?

Choose one answer.

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.