Basis Lab

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. A share pp of it can be done by many workers

at the same time. The rest 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
the share of the original work that can be done by many workers at once, so the serial share is 1 minus p and takes the same time whatever happens
the number of workers, which only ever divides the p part and never touches the rest
how many times faster the whole job runs than it did with one worker
Let grow without limit and the second term in the denominator vanishes, leaving equal to one divided by the serial share. That is the ceiling, and has dropped out of it entirely, which is the one thing worth taking from the algebra: no number of workers appears in the answer to how fast the job can possibly go.

The arithmetic is worth doing once by hand, because the result is unintuitive.

With pp at ninety-five per cent, SS cannot pass twenty however large nn gets.

At ninety per cent it cannot pass ten, and at eighty per cent it cannot pass

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 at all, 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