Contributed by jason on from the load-of-you-know-what dept.
Ariane van der Steldt (ariane@) posted a reply to the OpenBSD misc mailing list last month that offered some valuable insight into how load is calculated in the BSD kernel. This is a topic that comes up routinely but remains largely misunderstood by the average user.
Read on for Ariane's explanation and comparison to Linux load...
Load on linux and load on BSD are two completely different things. On linux I recall load being the number of processes running or blocking, or something based on that.
On BSD, load is the number of processes which have (wanted to) run at least once in the most recent 5-second window, with a degradation over time. So, if you have a process that wakes up every 5 seconds and prints the time on your console, you have a load average of 1. Load is not the number of cpu cycles used.
A high load is just that: high. It means you have a lot of processes that sometimes run. High load does not mean your performance is going down or whatever: I ran a test today which generated a load of 200, but only used 10% of the cpu and was very responsive.
You can't compare load on linux with load on bsd, I'd really appreciate if people stopped comparing apples and oranges. :P
If you are interested in the internals of the system: load is the black magic that keeps the scheduling fair compared to the number of processes.
I had a chance to discuss this with Bob Beck (beck@). He agreed with Ariane's explanation and added his own thoughts.
More generally on most unixen load average is some measure of the size of the run queue - or the number of runnable processes over a set period. The above is essentially how openbsd calculates it. It will be slightly different everywhere else. Because it is number of runnable processes, over a time period, it can be quite deceiving if you're not aware of the basic idea behind it. It is not a measure of cpu usage.
(use vmstat 1 and look at user + system for a more accurate representation of cpu usage)
Thanks to Ariane and Bob for their insights.
(Comments are closed)