academy

Understanding system load and load averages

Jeff Kreeftmeijer

Jeff Kreeftmeijer on

Last updated:

Understanding system load
and load averages

Updated on 25 February 2024 to update example screenshots and outdated links.

Monitoring your system's load is essential for keeping your app running smoothly. AppSignal's Host metrics provide insights into your system's load average, showing how much load your system has been under over multiple time frames. You can also check this metric using tools like top, uptime, and w:

Shell
$ uptime 10:14:14 up 60 days, 17:42, 1 user, load average: 0.44, 0.28, 0.25

But what exactly does "load average" mean, and how should you interpret these numbers? In this post, we'll break down system load, explain how to read load averages, and show you how to monitor them effectively.

What Are Load Averages?

Load averages are usually displayed as three numbers, like in the example from uptime above. The three numbers at the end of the result show the average load in the last minute (0.44), in the last five minutes (0.28), and the last fifteen (0.25).

Load averages per host on AppSignal

On AppSignal, load averages are displayed by minute for the last twelve hours and per hour for longer periods. You can dive deeper into any moment with Time Detective and compare hosts in real time using our Host metrics dashboards.

System Load

To understand what these load averages tell us (and when to be alarmed), we first need to understand what system load means and how it's measured.

System load is essentially the number of active processes at any given time:

  • When idle, the load is 0.
  • When a process starts, the load increases by 1.
  • When a process completes, the load decreases by 1.

The load also includes processes waiting for CPU time. So, if one process is actively using the CPU and two others are queued, the load is 3.

Because of short-lived processes, load fluctuates rapidly—it can jump from 0 to 5 in milliseconds and drop back just as fast. Due to this volatility, it's more useful to look at the average load over time, which provides a clearer picture of how busy the system has been.

Load Averages

Now that we know how system load is counted, we can take a look at load averages. As we've seen, the load the system is under is usually shown as an average over time.

Generally, single-core CPU can handle one process at a time. An average load of 1.0 would mean that one core is busy 100% of the time. If the load average drops to 0.5, the CPU has been idle for 50% of the time.

If the load average rises to 1.5, the CPU was busy all the time while there was (on average) one other process waiting for 50% of the time, giving the CPU more work than it can handle.

Logical Processors

The general rule of thumb is that the load average shouldn't exceed the number of processors in the machine. If the number of processors is four, the load should generally stay under 4.0.

Keep in mind that this relates to logical processors instead of the actual physical ones on the CPU. Because of software abstractions like hyper-threading, the number of logical processors, or processing threads, can be higher than the number of physical processor cores.

To check the number of logical processors on Linux, count the processors listed in /proc/cpuinfo, or use:

Shell
grep processor /proc/cpuinfo | wc -l

Which will print out the number of processor lines automatically. On a mac, you can ask sysctl for the number of logical processors directly by using:

Shell
sysctl -n hw.ncpu

For a system with multiple logical processors, the load average can grow higher, because it can run more concurrent processes. On a machine with two CPU cores, a load average of 2.0 means both CPUs were 100% utilized, while two processes were active on average.

👋 Take a look at other Ruby (on Rails) performance articles in our Ruby performance monitoring checklist.

Reading Load Averages

Since it's an average of the absolute number of processes, it can seem difficult to determine what a proper load average is, and when to be alarmed. In general, since each of your CPU cores can handle one process at a time, the system isn't overloaded until it goes over 1.0 per logical processors. On a dual-core system (without hyper-threading), that'd be 2.0.

Usually, it's fine if the load average is above 1.0 per core in the last minute mark, but elevated load in the five or fifteen-minute averages could indicate a problem.

Monitor Your Hosts with AppSignal

Understanding load averages is key to keeping your app healthy. With features like Error Tracking, Anomaly Detection, and Log Management, AppSignal helps you spot issues before they become problems.

Want to monitor your app with powerful insights and smart alerts? Start a free 30-day trial, no credit card needed.

Have questions or feedback? Let us know, our experts are on hand to answer your monitoring queries!

Wondering what you can do next?

Finished this article? Here are a few more things you can do:

  • Share this article on social media

Become our next author!

Find out more

AppSignal monitors your apps

AppSignal provides insights for Ruby, Rails, Elixir, Phoenix, Node.js, Express and many other frameworks and libraries. We are located in beautiful Amsterdam. We love stroopwafels. If you do too, let us know. We might send you some!

Discover AppSignal
AppSignal monitors your apps