A Nagios CPU load CRITICAL alert means the server's load average has gone above the critical threshold set in your monitoring. Load is the number of processes that are running or waiting to run, so a high value means the server is busy or stuck. This guide explains how to check the load and find the cause.
Understanding the alert
Nagios uses the check_load plugin to read the load average over 1, 5 and 15 minutes. Each value is compared with a warning and a critical threshold.
Load is not a percentage. To compare it with your server, divide the load by the number of CPU cores. A load of 4 on a 4-core server means the CPUs were busy all the time. A load of 4 on a 1-core server means the server was heavily overloaded.
Load also counts processes waiting for disk or other input and output (I/O), not only processes using the CPU. A high load can therefore come from a slow disk as well as from heavy traffic.
Diagnose the high load
Steps to follow
- Log in to your server over SSH. SSH is a secure way to run commands on a server. Your welcome email or the client area at https://my.hostking.host shows your login details.
- Run
uptimeand note the three load averages. - Run
nprocand note the number of CPU cores. - Compare the load with the core count. If the load is higher than the number of cores, the server is overloaded.
- Run
topand look at theusandsyvalues. High values mean the CPU is busy with user or system work. - Look at the
wavalue intop. A high value means processes are waiting for disk. - Press q to close
top. - Run
vmstat 1for a few seconds, then press Ctrl+C to stop it. A highrcolumn means CPU saturation. A highbcolumn with a highwavalue means I/O wait. - Find the busy processes with
toporps aux --sort=-%cpu | head. Note the name of any process that uses a lot of CPU. - Check your scheduled tasks, such as backups or sync jobs, and note whether they run at busy times.
Fix the cause
The fix depends on what you found in the checks above. Make one change at a time, so you can see which change worked.
cPanel
- Open cPanel and go to Cron Jobs. Check whether any job runs at the same time as the high load.
- Move heavy jobs, such as backups, to a quieter time of day.
- Check your site's resource usage in cPanel, if this is shown on your account.
- If a script or application uses a lot of CPU, review its settings or update it. For WordPress, you can disable plugins you no longer use.
DirectAdmin
- Log in to DirectAdmin and open Cron Jobs. Check whether any job runs at the same time as the high load.
- Move heavy jobs to a quieter time of day.
- If a script or application uses a lot of CPU, review its settings or update it.
Check the result
- Wait a few minutes after your change.
- Run
uptimeagain. - If the one-minute load falls and stays below the number of cores, the cause is likely fixed.
Troubleshooting
The load goes down when you log in. This is often a scheduled job, such as a backup. Check your cron jobs and move them.
The wa value is high. The server is waiting for disk. Check for large file transfers or backups running at the same time. If the problem continues, contact support.
The load rises again after a few hours. Check whether traffic has increased. Cache your pages, or reduce the number of plugins or scripts that run on each page.
You cannot find the cause. Save the output of uptime, nproc and top so you can share it with support.
If you are still stuck, contact Hostking support by live chat on the website or by opening a support ticket from the client area at https://my.hostking.host.
