CSE Roadmap

Core tier · about 3 hours · 7 parts

Part 2 of 7 · 2 min read

The report

Think of a patient who says "I feel unwell". A good doctor does not prescribe at once. She asks what is wrong, measures, and finds the cause before treating it. The analogy stops in one place: a patient stays the same during a test, while a server's load changes as you look at it.

In plain words: A team reports: "Our small log writer is slow. Each request appends one 4 KiB record, and the disk must be the problem." The first step is to state the symptom in numbers: how many records per second, and how long each record takes. The second is to see what the program asks of the system: how many writes, and how it makes them safe. The third is to find the largest part of the time. Only then is a change made, one at a time, and the numbers are measured again.

A worked example (made up to show the idea). The service must accept 20,000 records per second at peak and now manages about 7,000. The target is therefore at least 3 times faster. The team's first idea is to buy a faster disk. The method asks first whether the disk is busy or the program is waiting for something else.

The key lines. Four questions guide the work. What is the rate? Where does one record spend its time? What does the program do that forces waiting? What is the cheapest change that removes that wait, and what does it cost in safety?

Bottleneck

A bottleneck is the part of a system whose limit decides the rate of the whole system. Speeding up any other part changes nothing until the bottleneck is removed or its limit is raised.

Example: a program that waits for each fsync is limited by the time of one fsync, however fast the disk's data rate is.

Check yourself: 1. Why does the plan start with a number and not with a guess? 2. What are the four questions of the method? 3. Why would a faster disk possibly not help here?