skip to content

Amdahl's law says parallel speedup is capped at 1 divided by the serial fraction, while Gustafson's law predicts speedup that keeps growing with processor count. Which assumption differs between the two models, and when does each one apply?

level: seniorimportance: should knowfreq 33%

answer

  1. Amdahl = fixed size, strong scaling, ceiling 1/s
  2. Gustafson = fixed time, weak scaling, S = N - s(N-1)
  3. s=0.05, N=100: 16.8x vs 95x
  4. latency question vs capacity question
  5. both ignore coordination cost

basics

~20 s

Amdahl fixes the problem size and asks how much faster it finishes; Gustafson fixes the runtime and asks how much bigger a problem you can solve. Scaled speedup is S = N - s(N-1), which grows with N because the parallel work grows too.

solid answer

~50 s

They differ on **what is held constant**. - **Amdahl**: fixed problem size, growing machine (strong scaling). Serial seconds stay constant while parallel seconds shrink, so the serial fraction *grows* as a share of runtime and speedup is capped at `1/s`. - **Gustafson**: fixed runtime, growing problem *and* machine (weak scaling). The serial part stays roughly constant while the parallel work scales with N, so the serial fraction *shrinks*. Scaled speedup is `S(N) = N - s(N - 1)`, essentially linear in N. With s = 0.05 and N = 100: Amdahl gives 16.8x, Gustafson gives 95.05x. Same code, same serial fraction, different question. Use Amdahl when latency on a given input is the goal — one report must render faster, one request must return sooner. Use Gustafson when capacity is the goal — more traffic, higher resolution, larger models within the same time budget. Most production services are closer to Gustafson: you buy hardware to serve more load, not to make one fixed job finish sooner.

code

text · 10 lines
text
Amdahl (fixed work):     S(N) = 1 / (0.05 + 0.95/N)
Gustafson (scaled work): S(N) = N - 0.05*(N - 1)

  N        Amdahl    Gustafson
  10        6.90x       9.55x
  50       15.76x      47.55x
 100       16.81x      95.05x
1000       19.63x     950.05x

Amdahl flattens toward 20x; Gustafson stays near-linear.

go deeper

for a junior

Recall the one-line contrast: Amdahl holds the problem size fixed, Gustafson lets the problem grow with the machine, which is why one has a ceiling and the other does not.

for a middle

Reproduce both formulas, plug in numbers to show 16.8x versus 95x for the same 5% serial fraction, and name strong versus weak scaling.

for a senior

Classify your own workload before choosing a model, and explain why a service can scale throughput linearly while per-request latency is stuck. Call out that both are optimistic upper bounds.

for a principal

Frame the choice as which constraint the business actually holds fixed — deadline or input — and design so the serial portion does not grow with the workload, since that constant-s assumption is what makes capacity spending worthwhile.

## The two questions Both laws model the same program with the same sequential portion. They disagree because they ask different questions. **Amdahl asks:** *I have this exact job. How much faster can N processors finish it?* Problem size fixed, hardware grows. This is **strong scaling**. **Gustafson asks:** *I have this much time. How much more work can N processors do in it?* Runtime fixed, hardware and problem grow together. This is **weak scaling**. ## Why the fixed thing changes the answer Under Amdahl, normalize the one-worker runtime to 1 and split it into serial `s` and parallel `1 - s`. Adding workers shrinks only the parallel part, so as N grows the serial seconds become a larger *share* of a shrinking total. The serial part is the bottleneck by construction, and speedup saturates at `1/s`. Gustafson starts from the other end: measure the *parallel* execution. Suppose on N workers the run spends fraction `s` of its time serial and `1 - s` in parallel work that N workers are all busy on. Doing that same work on one worker would take `s + N(1 - s)` time units, because the parallel portion would have to be executed N times over sequentially. So: `S(N) = s + N(1 - s) = N - s(N - 1)` This is linear in N with slope `1 - s`. There is no ceiling. The key move is that the parallel workload **grew with the machine** — bigger mesh, more rows, more requests — while the serial startup/aggregation stayed about the same size. ## A worked comparison Take `s = 0.05` and `N = 100`. - Amdahl: `1 / (0.05 + 0.95/100) = 16.8x`. Discouraging. - Gustafson: `100 - 0.05 x 99 = 95.05x`. Nearly linear. Nothing about the program changed. The first number says "a fixed job will not get 100x faster"; the second says "in the same wall-clock time you can process about 95x more work." Both are true statements about the same system. ## Which one your situation is Ask what a stakeholder will do with more hardware. **Amdahl-shaped (strong scaling)** when the input is given and latency is the goal: - One nightly report that must finish before 6am. - One simulation of a fixed model that must return in an hour. - A single request's tail latency. Here the serial fraction is the enemy and the ceiling is real. Buying 4x the cores for a job with 20% serial work gets you 2.5x and nothing more will help. **Gustafson-shaped (weak scaling)** when the workload expands to fill capacity: - A web service: more instances serve more concurrent users. - A search index: bigger machine, bigger corpus, same query latency. - Scientific simulation at higher resolution as the cluster grows. Here added capacity converts into more work done, and near-linear scaled speedup is achievable — provided per-worker coordination cost does not grow. Many real systems are a blend: capacity scales weakly (more nodes, more traffic) while each individual request is strongly bound by its own serial critical path. It is entirely normal for a service to scale throughput almost linearly to 50 nodes while single-request latency refuses to improve at all. Those two facts are Gustafson and Amdahl describing different axes of the same system, not a contradiction. ## Where each model over-promises Gustafson's optimism has conditions, and interviews probe them: 1. **The serial part must not grow with the problem.** If aggregation, coordination, or the final merge scales with input size or with N, the constant-`s` assumption breaks and the linearity collapses. 2. **The problem must actually be scalable.** Some workloads have a natural size; you cannot "scale up" reconciling last month's ledger. 3. **Coordination cost is still ignored.** Like Amdahl, Gustafson assumes free communication. At high N, crosstalk between workers can eat the gains — a cost neither law models, and one that requires a model with an explicit interaction penalty. 4. **Bigger results are not always more valuable.** A 100x larger simulation is only progress if the extra resolution is useful. ## How to answer this in an interview Do not describe them as rival claims where one is right. Say: same program, same serial fraction, different constraint held fixed — size versus time. Then name your own system's constraint and pick the matching model. The strongest answers add the caveat that both laws assume perfect, cost-free parallel work, so both are upper bounds; measured curves sit below them and, unlike either formula, can turn downward at high concurrency.

  • Your service scales throughput almost linearly to 50 nodes, but single-request latency never improves. Is that a contradiction?
    No — it is both laws describing different axes. Throughput is weak scaling: more nodes, more independent requests, so scaled speedup is near-linear. A single request's latency is strong scaling: its own serial critical path is fixed, so extra nodes cannot shorten it. Improving latency requires attacking that request's sequential work, not adding capacity.
  • What breaks Gustafson's near-linear prediction in practice?
    Chiefly a serial portion that grows with the problem or with N — a final aggregation, a coordinator, a global lock touched more often as work scales. Gustafson also assumes free communication, so cache-coherence traffic, network chatter, and shared-state updates can erode the gains. If the serial share is not constant as you scale, the linearity assumption is invalid.

Amdahl: one wall, more painters — the ladder-setup time you can't share caps how fast the wall is done. Gustafson: a fixed 8-hour day, more painters — you simply paint more walls.

saying these in an interview costs you the question

  • Saying one law is 'right' and the other 'wrong' rather than noting they hold different quantities fixed
  • Claiming Gustafson repeals Amdahl — Amdahl still binds any fixed-size job
  • Applying Gustafson to a workload whose size cannot grow, such as a single fixed report
  • Forgetting that Gustafson assumes the serial portion stays constant as the problem grows
  • Treating either law as accounting for communication overhead

context