What should server load average be




















If your load average is above 5. Don't let it get there. On a multi-processor system, the load is relative to the number of processor cores available. If we go back to the bridge analogy, the "1. On a one-lane bridge, that means it's filled up. On a two-lane bridge, a load of 1.

Same with CPUs: a load of 1. On a dual-core box, a load of 2. While we're on the topic, let's talk about multicore vs. For performance purposes, is a machine with a single dual-core processor basically equivalent to a machine with two processors with one core each?

There are lots of subtleties here concerning amount of cache, frequency of process hand-offs between processors, etc. Despite those finer points, for the purposes of sizing up the CPU load value, the total number of cores is what matters, regardless of how many physical processors those cores are spread across. It's all eight cores for these purposes. This is on a dual-core CPU, so we've got lots of headroom. I won't even think about it until load gets and stays above 1.

Fortunately, I did finally find the change, in a compressed mailbox file from on oldlinux. Here it is:. This confirms that the load averages were deliberately changed to reflect demand for other system resources, not just CPUs.

Linux changed from "CPU load averages" to what one might call "system load averages". However, load averages decreased because they only tracked the CPU running states and not the swapping states. Matthias thought this was nonintuitive, which it is, so he fixed it. In Linux 0. Nowadays, in Linux 4. It's possible that one of these codepaths should not be included in the load averages. Next time I have load averages that seem too high, I'll see if that is the case, and if it can be fixed.

I emailed Matthias for the first time to ask what he thought about his load average change almost 24 years later. He responded in one hour as I mentioned on Twitter , and wrote:. Should we change load averages to be just CPU and disk demand? It begs another question, however, which is what do we really want? Do we want to measure demand on the system in terms of threads, or just demand for physical resources? If it's the former, then waiting on uninterruptible locks should be included as those threads are demand on the system.

They aren't idle. So perhaps Linux load averages already work the way we want them to. To better understand uninterruptible code paths, I'd like a way to measure them in action. Then we can examine different examples, quantify time spent in them, and see if it all makes sense. It provides many examples of uninterruptible code paths:. If you are new to off-CPU flame graphs: you can click on frames to zoom in, examining the full stacks which appear as a tower of frames. The x-axis size is proportional to the time spent blocked off-CPU, and the sort order left to right has no real meaning.

The color is blue for off-CPU stacks I use warm colors for on-CPU stacks , and the saturation has random variance to differentiate frames. I generated this using my offcputime tool from bcc this tool needs eBPF features from Linux 4. I'm using awk to change the output from microseconds to milliseconds. Facebook's Josef Bacik first did this with his kernelscope tool, which also uses bcc and flame graphs. In my examples, I'm just showing the kernel stacks, but offcputime. As for the flame graph above: it shows that only ms out of 60 seconds were spent in uninterruptible sleep.

That's only adding 0. Here is a more interesting one, this time only spanning 10 seconds SVG :. I've highlighted those functions in magenta using the flame graph search feature.

The interruptible versions allow the task to be interrupted by a signal, and then wake up to process it before the lock is acquired. Time in uninterruptible lock sleeps usually don't add much to the load averages, but in this case they are adding 0. Does it make sense for these code paths to be included in the load average?

Yes, I'd say so. Those threads are in the middle of doing work, and happen to block on a lock. They are demand on the system, albeit for software resources rather than hardware resources.

Can the Linux load average value be fully decomposed into components? Here's an example: on an idle 8 CPU system, I launched tar to archive some uncached files.

It spends several minutes mostly blocked on disk reads. Here are the stats, collected from three different terminal windows:. Save my name, email, and website in this browser for the next time I comment. Notify me of followup comments via e-mail. You can also subscribe without commenting. This site uses Akismet to reduce spam. Learn how your comment data is processed. Load average — is the average system load calculated over a given period of time of 1, 5 and 15 minutes.

Note that: All if not most systems powered by Linux or other Unix-like systems will possibly show the load average values somewhere for a user. A downright idle Linux system may have a load average of zero, excluding the idle process.

Nearly all Unix-like systems count only processes in the running or waiting states. If you liked this article, then do subscribe to email alerts for Linux tutorials. Best Drones. Best 4K TVs.

Best iPhone 13 Cases. Best Tech Gifts for Kids Aged Best 8K TVs. Best VR Headsets. Best iPad Mini Cases. Best Gifts for Cutting the Cord. Best Bluetooth Speakers. Awesome PC Accessories. Best Linux Laptops. Best Gaming Monitors. Best iPads. Best iPhones. Best External Hard Drives. Browse All News Articles. Smart TVs Ads. Team Comes to Workplace by Meta. Block People Spotify.

Verizon Selling PS5. Windows 11 SE Explained.



0コメント

  • 1000 / 1000