How we talk about CPU (or processors, or cores, or...)

submited by
Style Pass
2021-05-21 17:30:03

There are a bunch of ways that we talk about CPU, and they're not all measuring the same thing. We're not even always talking about the same physical part of the computer! More on that in a bit, though. Let's talk about the numbers first.

There's the load average sense, where you get to see the run queue averaged over three spans of time. Those are the number of things which are actually running or are trying to run. This has changed subtly in some places over the years to include or exclude different things.

A load average can be particularly fun since it usually (on Linux) includes stuff that's in the kernel and trying to run but is stuck on some kind of lock, like if reading /proc/pid/cmdline gets stuck, or a NFS mount is hung, or whatever. If you stack a bunch of those up from cron jobs or other repetitive things, you might end up with a load average in the hundreds or thousands... and still have a perfectly responsive machine!

On the other hand, if you have just a couple of jobs, but they are consuming every resource they can, then you might have a load average barely higher than the CPU (or processor, or thread... see below) count on the box and yet it'll take 5 minutes to just display the shell prompt when you log in.

Leave a Comment