Scalability Fundamentals

Scalability Laws


Learning Objectives

  • You know of Amdahl’s Law and Gunther’s Universal Scalability Law.
  • You can apply the laws to calculate the potential speedup from parallelization.

Vertical and horizontal scalability highlight classic strategies to scaling software. There are, however, theoretical limits on scaling.

Scalability laws are formulations of how the performance of a system changes as the resources change. Two classic formulations — Amdahl’s Law and Gunther’s Universal Scalability Law — outline that linear scalability is often impossible.

Amdahl’s Law

Amdahl’s Law posits that the speedup of a program using parallel computing is limited by the portion of the program that cannot be parallelized. It models the total execution time of a program as consisting of two parts: the fraction that is inherently sequential and cannot be parallelized, and the fraction that is parallelizable and can benefit from being executed across multiple workers.

Amdahl’s Law provides a formula for the maximum theoretical speedup achievable by parallelizing the parallelizable parts of a program, which diminishes as the number of workers increases due to the sequential portion dominating the total execution time.

Loading Exercise...

The formula for Amdahl’s Law is as follows:

𝑆(𝑁)=𝑁1+𝑃(𝑁1)

Where:

  • 𝑆(𝑁) is the speedup of the program when using 𝑁 workers (e.g. processors).
  • 𝑃 is the proportion of the program that cannot be parallelized.
  • 𝑁 is the number of workers to which the parallel work can be divided.

As an example, if we have a program where 20% of the work cannot be parallelized and 5 workers, the maximum theoretical speedup would be calculated as follows:

𝑆(5)=51+0.2*(51)=51+0.2*4=51+0.8=51.82.778

This means that there is a possibility to improve the execution time of the program by 178%, or, in other words, the execution time of the program could be reduced to approximately 36% of the original execution time (12.778).

Similarly, if we would have a program where 95% of the work cannot be parallelized and 10 workers, the maximum theoretical speedup would be calculated as follows:

𝑆(10)=101+0.95*(101)=101+0.95*9=101+8.55=109.551.047

Here, there would be the possibility to improve the execution time of the program by slightly less than 5%, or, in other words, the execution time of the program could be reduced to approximately 95% of the original execution time (11.047). Depending on the context, it is a good question whether the parallelization would be worth the effort.

For additional details, see: G. M. Amdahl, “Validity of the single processor approach to achieving large scale computing capabilities”. AFIPS spring joint computer conference. 1967.

Loading Exercise...

Gunther’s Universal Scalability Law

Gunther’s Universal Scalability Law extends Amdahl’s Law by including communication overhead. It models the total execution time of a program as consisting of three parts: the fraction that is inherently sequential and cannot be parallelized, the fraction that is parallelizable, and the fraction that is communication overhead related to parallelization.

Note that we are intentionally simplifying the formulation of Gunther’s Universal Scalability Law here. Gunther’s Universal Scalability Law does not just discuss programs, but resources in general. In effect, it describes how the performance of a system changes as the number of users or resources changes.

Loading Exercise...

The formula for Gunther’s Universal Scalability Law is as follows:

𝑆(𝑁)=𝑁1+𝛼(𝑁1)+𝛼𝛽𝑁(𝑁1)

Where:

  • 𝑆(𝑁) is the improvement of the program when using 𝑁 workers.
  • 𝛼 represents contention in the system (i.e., the proportion of the program that cannot be parallelized).
  • 𝛽 represents coherency traffic (i.e., communication overhead).

As an example, if we would have a program where 20% of the work cannot be parallelized, 5 workers, and a 5% communication overhead, the maximum theoretical improvement would be calculated as follows:

𝑆(5)=51+0.2*(51)+0.2*0.05*5*(51)=51+0.8+0.2*0.05*5*4=51+0.8+0.2*0.05*20=51+0.8+0.2*1=51+0.8+0.2=52=2.5

That is, there would be the possibility to improve the execution time of the program by 150%, or, in other words, the execution time of the program could be reduced to approximately 40% of the original execution time. When compared to the calculation using Amdahl’s Law, the communication overhead has somewhat decreased the maximum theoretical improvement.

When we consider the case with 95% of the work that cannot be parallelized and 10 workers, where Amdahl’s Law would suggest a slight improvement, adding a 5% communication overhead leads to a decrease in performance:

𝑆(10)=101+0.95*(101)+0.95*0.05*10*(101)=101+0.95*9+0.95*0.05*10*9=101+0.95*9+0.95*0.05*90=101+0.95*9+4.275=101+8.55+4.275=1013.8250.723

Above, there would be no possibility to improve the execution time. Instead, the parallelization of the work would lead to a decrease in performance.

For additional details, see: (1) N. J. Gunther, A Simple Capacity Model of Massively Parallel Transaction Systems. CMG National Conference. 1993.; (2) http://www.perfdynamics.com/Manifesto/USLscalability.html.

Loading Exercise...