ContentsThe library

Doing Two Things at Once

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.

FIG 1The best speedup available from a given serial share
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
Let the worker count grow without limit and the last term vanishes, leaving the speedup equal to one divided by the serial share. That is the ceiling, and it does not depend on the worker count at all.

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 contents

This 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

The rest of this course

  1. 01The Update That Vanished
  2. 02A Door That Admits Oneopening only
  3. 03The Bill Arrives as Latencyopening only
  4. 04Everybody Holding, Nobody Movingopening only
  5. 05Try, Check, Try Againopening only
  6. 06The Promise Is Weaker Than You Thinkopening only
  7. 07The Ceiling You Cannot Buyyou are here
  8. 08The Problem You Decide Not to Haveopening only

Read alongside