Load average in Linux shows the number of processes waiting for CPU time over one, five, and fifteen minutes. It’s a quick way to see if your system is overloaded or running smoothly. Many new Linux users find this metric confusing, but it’s actually simple once you understand the basics.
You see load average when you run commands like top or uptime. It looks like three numbers: 0.50, 0.75, 1.20. These numbers represent the average system load over the last 1, 5, and 15 minutes.
Think of it like a queue at a coffee shop. If there’s one barista (one CPU core), a load of 1.0 means the barista is exactly busy. A load of 2.0 means there’s one person waiting. A load of 0.5 means the barista is half idle.
This article will explain everything you need to know about load average. You’ll learn what it means, how to check it, and what to do when it’s high.
What Is Load Average In Linux
Load average is a metric that shows the average number of processes in the system’s run queue over a specific time period. The run queue includes processes that are either currently running on the CPU or waiting for CPU time.
It’s not just about CPU usage. Load average also accounts for processes waiting on disk I/O or other resources. This makes it a more complete picture of system demand than CPU percentage alone.
The three numbers you see represent different time windows. The first is the average over the last minute. The second is over the last five minutes. The third is over the last fifteen minutes.
Comparing these numbers tells you if load is increasing or decreasing. If the 1-minute value is higher than the 15-minute value, load is rising. If it’s lower, load is falling.
How Load Average Is Calculated
The Linux kernel calculates load average using an exponential moving average. This means recent activity has more weight than older activity. The formula uses specific constants for each time window.
For the 1-minute average, the kernel uses a decay factor of 1/exp(5/60). For the 5-minute average, it’s 1/exp(5/300). For the 15-minute average, it’s 1/exp(5/900).
You don’t need to memorize these numbers. Just understand that the calculation smooths out spikes and gives you a trend. A single high spike won’t drastically change the 15-minute average.
What The Numbers Actually Mean
To interpret load average, you need to know how many CPU cores your system has. A load of 1.0 on a single-core system means the CPU is fully utilized. On a quad-core system, 1.0 means only 25% utilization.
Here’s a simple breakdown:
- Load below number of cores: System is underutilized
- Load equal to number of cores: System is fully utilized
- Load above number of cores: Processes are waiting for CPU
For example, on a 4-core system:
- Load of 2.0: 50% utilization, no waiting
- Load of 4.0: 100% utilization, no waiting
- Load of 6.0: Overloaded, 2 processes waiting on average
Remember that load average includes processes waiting for I/O too. A high load doesn’t always mean CPU is the bottleneck. It could be a slow disk or network.
How To Check Load Average In Linux
There are several ways to view load average. The most common commands are uptime, top, and cat /proc/loadavg. Each gives you the same three numbers in slightly different formats.
Using The Uptime Command
The uptime command shows how long the system has been running, how many users are logged in, and the load average. It’s the simplest way to check.
Run this in your terminal:
uptime
Output example:
14:32:10 up 3 days, 2:15, 2 users, load average: 0.45, 0.62, 0.71
The load average is at the end of the line. The first number (0.45) is the 1-minute average. The second (0.62) is the 5-minute average. The third (0.71) is the 15-minute average.
Using The Top Command
The top command gives you a real-time view of system processes. Load average appears at the top of the output, on the same line as uptime information.
Run:
top
Look for the line that starts with “load average:”. It’s usually the third line from the top. The format is the same as uptime.
Press q to exit top. You can also use htop for a more colorful display, but it may need to be installed separately.
Using The /Proc/loadavg File
The /proc/loadavg file contains the raw load average data. You can read it with cat or any text viewer.
Run:
cat /proc/loadavg
Output example:
0.45 0.62 0.71 2/345 12345
The first three numbers are the load averages. The fourth number (2/345) shows the number of currently running processes and total processes. The last number is the most recent process ID.
Using Other Tools
You can also check load average with w command, which shows who is logged in and system load. The gnome-system-monitor GUI tool also displays it.
For scripting, you can parse the output of uptime or cat /proc/loadavg. Many monitoring tools like Nagios, Zabbix, and Prometheus collect this metric automatically.
What Is A Good Load Average
A “good” load average depends entirely on your system’s hardware and workload. There’s no universal number that works for every server.
For a desktop system with 4 cores, a load average of 1.0 to 2.0 is usually fine. You might not notice any slowdown. Above 4.0, things may feel sluggish.
For a web server, you want load to stay below the number of cores most of the time. Brief spikes are okay, but sustained high load means you need more resources.
Load Average Vs CPU Usage
Many people confuse load average with CPU usage percentage. They are related but not the same. CPU usage shows how busy the CPU is right now. Load average shows the trend over time.
A system can have 100% CPU usage but a low load average if only one core is fully used. Conversely, a system can have 50% CPU usage but a high load average if many processes are waiting for I/O.
For example:
- Single-core CPU at 100% usage: Load average around 1.0
- Quad-core CPU at 100% usage: Load average around 4.0
- Quad-core CPU at 50% usage with I/O wait: Load average could be 8.0
Always check both metrics together. High CPU usage with high load average means CPU is the bottleneck. Low CPU usage with high load average means something else is blocking processes.
Common Misconceptions
One big misconception is that load average should never exceed 1.0. This is only true for single-core systems. On modern multi-core CPUs, higher loads are normal and acceptable.
Another myth is that load average only counts CPU-bound processes. In reality, it counts any process in the “runnable” or “uninterruptible sleep” state. This includes processes waiting for disk, network, or locks.
Some people think load average is a percentage. It’s not. It’s an absolute number that scales with CPU cores. A load of 2.0 on a 4-core system is 50% utilization, not 200%.
How To Troubleshoot High Load Average
When load average is high, you need to find the root cause. Start by checking which processes are consuming resources. Use top or htop to sort by CPU or memory usage.
Step 1: Identify The Bottleneck
Run top and press P to sort by CPU usage. Look for processes using high CPU. Press M to sort by memory usage. Check if any process is using excessive memory.
Use iostat -x 1 to check disk I/O. High %iowait means disk is slow. Use vmstat 1 to see system-wide stats including CPU, memory, and I/O.
Check network activity with nload or iftop. A network bottleneck can cause processes to wait, increasing load average.
Step 2: Check For Runaway Processes
A single runaway process can spike load average. Look for processes using 100% CPU on one core. Common culprits include infinite loops, poorly optimized scripts, or malware.
If you find a problematic process, you can kill it with kill -9 PID. Replace PID with the process ID from top. Be careful not to kill critical system processes.
Step 3: Analyze System Logs
System logs often contain clues about high load. Check /var/log/syslog or /var/log/messages. Look for errors related to disk, memory, or network.
Use dmesg to see kernel messages. Hardware errors or driver issues can cause high load. For example, a failing disk can cause constant I/O retries.
Step 4: Optimize Or Scale
If load is consistently high due to legitimate workload, you need to optimize or scale. Optimization means improving code, caching, or using more efficient algorithms.
Scaling means adding more resources. You can add more CPU cores, faster disks, or more memory. For web servers, consider load balancing across multiple machines.
Sometimes high load is temporary. A cron job or backup script might run at specific times. Schedule heavy tasks during off-peak hours to reduce impact.
Load Average And Multi-Core Systems
Understanding load average on multi-core systems is crucial. A 4-core system can handle a load of 4.0 without any processes waiting. A load of 8.0 means there are 4 processes waiting on average.
To normalize load average for your system, divide by the number of cores. This gives you a utilization ratio. A ratio of 1.0 means full utilization. Above 1.0 means overload.
For example:
- 8-core system, load 6.0: Ratio = 0.75 (75% utilization)
- 2-core system, load 3.0: Ratio = 1.5 (overloaded)
- 16-core system, load 12.0: Ratio = 0.75 (75% utilization)
You can find the number of CPU cores with nproc or lscpu. The nproc command returns just the number, making it easy for scripts.
Hyper-Threading And Load Average
Hyper-Threading (HT) makes each physical core appear as two logical cores. This can confuse load average interpretation. A system with 4 physical cores and HT shows 8 logical cores.
In most cases, treat logical cores as real cores for load average. HT improves throughput but doesn’t double performance. A load of 8.0 on an HT-enabled 4-core system may still cause slowdowns.
For critical systems, base your load thresholds on physical cores, not logical ones. This gives you a safety margin.
Real-World Examples Of Load Average
Let’s look at some real-world scenarios to make load average clearer.
Example 1: Idle Desktop
You check your desktop and see load average: 0.10, 0.15, 0.20. This is normal for an idle system. Background processes like systemd and your desktop environment use minimal resources.
Even with a browser open, load might stay below 1.0 on a modern system. This is perfectly fine.
Example 2: Busy Web Server
A web server with 8 cores shows load average: 6.50, 5.80, 4.20. The 1-minute average is higher than the 15-minute average, meaning load is increasing.
This is acceptable if traffic is growing. The server has headroom since load is below 8.0. You should monitor it to ensure it doesn’t exceed the core count.
Example 3: Database Server Under Stress
A database server with 16 cores shows load average: 22.0, 18.0, 15.0. This is clearly overloaded. Processes are waiting for CPU and possibly disk I/O.
Check disk I/O with iostat. If %iowait is high, the database might be hitting disk limits. Consider adding faster storage or optimizing queries.
Example 4: Compiling Software
You’re compiling a large program on a 4-core system. Load average spikes to 8.0 or higher. This is normal because compilation uses all cores heavily.
Once compilation finishes, load should drop quickly. Temporary high load during batch jobs is acceptable as long as it doesn’t affect other services.
Tools To Monitor Load Average Over Time
Monitoring load average over time helps you spot trends. A single snapshot doesn’t tell the full story. Use these tools to track load history.
Using Sar (System Activity Reporter)
The sar command collects and reports system activity. It’s part of the sysstat package. Install it with sudo apt install sysstat on Debian/Ubuntu.
To view historical load average:
sar -q
This shows load average at regular intervals. You can specify a date with -f /var/log/sysstat/saXX where XX is the day of the month.
Using Grafana And Prometheus
For production systems, use Prometheus to collect metrics and Grafana to visualize them. The node_exporter provides load average data.
Create a dashboard with load average over time. Add alerts when load exceeds thresholds. This gives you proactive monitoring instead of reactive troubleshooting.
Using Simple Scripts
You can write a simple bash script to log load average to a file:
#!/bin/bash
while true; do
uptime >> /var/log/load.log
sleep 60
done
This logs load every minute. Later, you can analyze the file with tools like awk or gnuplot.
Frequently Asked Questions
What Is A Normal Load Average In Linux?
A normal load average depends on your CPU core count. For a single-core system, below 1.0 is normal. For a quad-core system, below 4.0 is normal. Sustained values above the core count indicate overload.
Does Load Average Include Memory Usage?
No, load average does not directly measure memory usage. It counts processes in the run queue or waiting for I/O. High memory usage can indirectly cause high load if the system starts swapping.
Can Load Average Be High With Low CPU Usage?
Yes, this often happens when processes are waiting for disk I/O or network. Check iostat for high %iowait. The processes are in “uninterruptible sleep” state, which counts toward load average.
How Do I Reduce High Load Average?
Identify the bottleneck first. Kill runaway processes, optimize code, add more CPU cores, upgrade storage, or balance load across multiple servers. Sometimes simply restarting a misbehaving service helps.