The Ceiling You Cannot Buy
Last timeWhat a Transaction Promises
Whatever share of the work cannot be done at the same time sets a hard limit on how much faster the whole job can get, no matter how many workers you add.
The request arrives every few months in the same form. The service is too slow,
so please double the number of workers. Sometimes it helps. Often it does
nothing, and occasionally it makes things worse, and which of those happens is
predictable from a single number you can measure in an afternoon.
The share that cannot overlap
Take any job and split it in two. One part can be done by many workers at the
same time. The other part cannot, because one step must finish before the next
can begin.
The second part is everywhere once you look for it. A guarded region, from the
earlier lessons, is serial by definition. So is a commit to a single log, an
insert into one index, a final merge of per-worker results, and a check against a
single counter. None of those goes faster when you add a worker.
- how many times faster the whole job runs than it did with one worker
- the share of the original work that can be done by many workers at once
- the serial share, which takes the same time no matter how many workers there are
- the number of workers
- the parallel part's time after being split, which goes to nothing as workers are added
The arithmetic is worth doing once by hand, because the result is unintuitive. A
job that is ninety-five percent parallel caps out at twenty times. Ninety percent
caps at ten times. Eighty percent caps at five. A job that spends half its time
in a guarded region cannot be made more than twice as fast by any number of
machines, and most people's guess for that case is much higher.
The lesson stops here
3 more paragraphs to go
You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.
The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.
See the planThe contentsThis is the reading half
Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.
The contents