Gustafson's Law – When the Problem Grows With the Resources
A digression accompanying the Scalability series.
Photo: Kevin Ache @ Unsplash - Unsplash licence
In 1988, John Gustafson of Sandia National Laboratories reports results that should not really exist. His team has run three programs on a machine with 1,024 processors and arrives at a speedup of more than a thousand for all three. Yet the serial fraction of the runtime was between 0.4 and 0.8 percent.
According to Amdahl’s Law, that is impossible. The serial fraction – the part of the work that cannot be divided up – caps the maximum speedup. At 0.4 percent, the calculation ends at a factor of 250, no matter how many processors are added (covered in detail in Amdahl’s Law and the Limits to Growth). Gustafson reported four times that.
His explanation: Amdahl’s calculation is correct; it just answers a different question from the one his team had asked.
The core critique
Amdahl’s model applies to a fixed problem: a developer has existing code and the problem size is fixed; more processors are intended to reduce execution time. It is precisely at this point that the cap imposed by the serial fraction takes hold.
However, Gustafson had a different problem in mind. Those running weather simulations do not want to solve the same problem faster with more processors, but rather a larger problem: a finer grid, more data points and higher resolution in the same computation time. The problem size is not fixed; it grows with the resources available. Under this assumption, scaling looks entirely different.
The formula
Gustafson formulated this observation as a measure of scaled speedup, which is defined as the amount of work managed by a parallel system compared to a single processor:
\[S(n) = n - s \times (n - 1) \quad\text{or}\quad S(n) = s + n \times (1 - s)\]- $n$ is the number of processors.
- $s$ is the time fraction the serial part takes up on the parallel system – not the share of the overall problem, but the share of the actual execution time.
- $S(n)$ is the scaled speedup.
The crucial detail lies in the definition of $s$. For Amdahl, $s$ is the proportion of the problem that must remain serial, which is an inherent property of the algorithm independent of the number of processors. In contrast, for Gustafson, $s$ is the proportion of the measured runtime taken up by the serial code. If the problem grows with the number of processors, this share of the runtime stays the same – while the share of the serial code in the total work keeps getting smaller.
A climate simulation, for example, requires an initialization period of one hour (serial), followed by the actual computation (parallel). With 100 processors, the computation also takes one hour, meaning the serial time fraction is $s = 0.5$, and the scaled speedup is $S(100) = 100 - 0.5 \times 99 = 50.5$. Increasing the number of processors tenfold to 1,000 still results in a one-hour computation, but now on a grid with ten times as many points. $s$ remains 0.5 and $S(1000) = 1000 - 0.5 \times 999 = 500.5$. The speedup grows almost linearly with the number of processors.
For the same $s = 0.5$, Amdahl would have stopped at a factor of $1/s = 2$. The contradiction is only apparent. Amdahl’s factor of two applies when the initialization time of one hour is a fixed proportion of the overall problem. However, as soon as the parallel part grows with the number of processors, that same hour becomes relatively smaller and smaller – and the scaled speedup pulls away.
Amdahl: the grid stays the same. More processors only shorten the computation (blue); the hour of initialization (red) remains. The runtime drops from 2 to 1.1 hours and never below one.
Gustafson: the runtime stays at two hours, but 1,000 processors compute a grid with ten times as many points. The scaled speedup rises from 50.5 to 500.5.
Where the calculation works out
The clearest examples of this come from high-performance computing. For example, a weather simulation uses more processors to achieve a finer spatial grid: the number of grid points increases linearly with the number of processors, while the time taken for initialization (loading data and setting boundary conditions) remains almost constant. This results in almost linear speedup, as predicted by Gustafson.
The same pattern repeats with rendering. A render farm does not distribute one frame across all nodes; rather, each frame is sent to its own node. More nodes mean that the same film can be produced in a higher resolution or with more detail in the same time, rather than a single frame in a fraction of the time. In genome sequencing, more compute nodes do not accelerate the sequencing of a single genome; rather, they process more genomes in parallel. Each node works independently on a different dataset, without coordinating with the others. Such problems, which require no coordination between units, are called “embarrassingly parallel.”
The pattern is the same in all three cases: the parallel part grows proportionally to the number of processors, while the serial part – initialization, coordination and merging the results – either remains absolutely constant or grows much more slowly.
Where it breaks down
The formula hinges on an easily overlooked assumption: the serial work must not grow along as the number of processors increases. In HPC examples, this is plausible – one hour of initialization remains one hour, regardless of whether 100 or 10,000 processors are computing.
However, this assumption breaks down as soon as the coordination between units grows with $n$. If each new processor brings additional communication overhead as well as its parallel part, then $s$ is no longer constant – it rises with $n$, and the optimistic forecast collapses.
This is precisely what occurs in distributed systems that do not employ the shared-nothing pattern. Cache invalidation, distributed locks and consensus algorithms all create coordination costs that grow with the number of nodes. Gustafson’s approach is therefore of no further help here; Gunther’s Universal Scalability Law (see Amdahl’s Law and the Limits to Growth) models this case, with its quadratically growing coherency term κ capturing precisely the costs that Gustafson ignores.
Amdahl or Gustafson – when does which apply?
The two laws are not competitors; they answer different questions. Amdahl’s law applies when the problem size is fixed, such as a search service designed to handle 1,000 requests per second with a response time of 50 ms. In this case, the key question is how much parallelism can help. Gustafson applies when the problem size grows alongside the available resources, such as in a data analysis on a cluster where more nodes mean more data rather than faster processing.
For most web systems, Amdahl is clearly the better option. The load comes from outside and cannot be freely chosen. No one says, “We now have ten servers, so let’s double the number of pages.” Users either come or they don’t – the question is always whether capacity is sufficient. This scaling under an externally imposed load is precisely what my series on the scalability of web systems is about.
Gustafson’s optimistic forecast depends on the serial work not growing along, and under load that is exactly what cannot be taken for granted. More concurrent users mean more coordination around shared resources, such as a shared database or locks on the same records. This part of the work grows with the load instead of fading beside it. So Gustafson does not refute Amdahl. He shows under which conditions Amdahl’s ceiling does not apply, and in web systems those conditions are rarely met on their own.
References
- Gustafson (1988) – Reevaluating Amdahl’s Law. Communications of the ACM, 31(5), 532–533.
- Amdahl (1967) – Validity of the single processor approach to achieving large scale computing capabilities. AFIPS Spring Joint Computer Conference Proceedings, Vol. 30, 483–485.
- Gunther (2007) – Guerrilla Capacity Planning. Springer.
Comments