## [Unix] Load average

You saw this:

% uptime
05:30:41 up 3 days, 14:26, 16 users,  load average: 9.49, 13.17, 17.39


The same info can be obtained from the virtual 'proc' file:

% cat /proc/loadavg
8.83 12.66 17.08 3/714 3609351


These 3 numbers reflect your system's load for 1/5/15 minutes. But what a number mean?

In short: if your system's logical CPU cores number is bigger than load average, this is good. This means, that your system is underloaded.

How to get the (logical) CPU cores number on your Linux? Cat this file: /proc/cpuinfo

If the load average is bigger than CPU cores number, this is bad: threads are stuck in queue, waiting for a CPU core to run on.

In other words, this value is a number of CPU cores that your system would need to process all the tasks it currently has in queue.

My philosophy: to load my CPU I paid my money for, I try to load my Linux box so that load average will be 1 or 2 less than CPU cores number (by setting number of thread, for example). This is ~10 for 12 (logical) core CPU. A bigger value can be dangerous: a system can stuck, even your SSH daemon can stop to respond.

Yes, I know about these lousy Disqus ads. Please use adblocker. I would consider to subscribe to 'pro' version of Disqus if the signal/noise ratio in comments would be good enough.