CPUs, cloud VMs, and noisy neighbors: the limits of parallelism
Sometimes your program is slow not because of your code, but because of where it’s running.
If you have other processes competing for the same limited hardware resources, your code will run more slowly.
Once you add virtualization into the mix, those competing processes might be invisible… but they’re still there.
In this article we’ll cover:
- The hardware limits of CPUs’ cores and “hyperthreads”.
- How operating systems deal with multiple processes that want to use limited number of CPU cores.
- The impact of virtualization on these various resources, including what cloud vCPUs mean.
- CPU sharing limits available via containers.
The parallelism limits of your CPU
As a gross simplification, back in the day many computers only had a single core, which meant only one computation could happen