๐Ÿง  How to Diagnose High Server Loads on a cPanel Server

High server loads can degrade website performance, delay backups, or even lead to service downtime. Diagnosing the root cause quickly is essential. This guide walks you through identifying high loads using common Linux tools, including top, uptime, ps, and vmstat.


๐Ÿ” Step 1: Understand What โ€œHigh Loadโ€ Means

What is Load Average?

The load average represents the number of processes waiting to run on the CPU.

Check current load averages:

uptime

Sample output:

 12:05:34 up  5:42,  1 user,  load average: 6.08, 4.27, 2.15
  • First number = 1 minute average
  • Second = 5 minutes
  • Third = 15 minutes

๐Ÿ‘‰ Compare load to CPU cores: A load of 6 on a 4-core server is high; a load of 6 on a 16-core server may be fine.


๐Ÿ“ˆ Step 2: Use top to Find Real-Time Load Sources

top -c

Look for:

  • High CPU usage
  • High memory usage
  • Unusual processes (e.g., spam scripts, PHP loops, MySQL queries)

Press Shift + M to sort by memory
Press Shift + P to sort by CPU


๐Ÿงช Step 3: Use ps to Identify Resource-Heavy Processes

ps aux --sort=-%cpu | head -20

Or:

ps aux --sort=-%mem | head -20

This helps isolate processes consuming excessive resources.


๐Ÿ“Š Step 4: Analyze System Performance with vmstat

The vmstat tool provides insight into CPU usage, memory, I/O wait, and system activity.

Run:

vmstat 2 10

This samples system data every 2 seconds for 10 intervals.

Key Columns to Watch:

ColumnMeaning
rProcesses waiting for CPU (should be โ‰ค # of cores)
us% CPU used by user processes
sy% CPU used by system processes
id% CPU idle (low = busy system)
wa% CPU waiting on I/O (high = disk bottleneck)
si/soSwap in/out (high = memory exhaustion)

๐Ÿ”Ž Tip: If wa is consistently high (e.g., 20%+), your disk may be the bottleneck.


๐Ÿ“‚ Step 5: Check Disk I/O with iostat

yum install sysstat -y   # if not already installed
iostat -xz 1 10

Check for:

  • High %util (over 90% = saturated disk)
  • High await time

๐Ÿ” Step 6: Check for Abuse or Misbehaving Users

Check which users are consuming excessive resources:

ps -eo user,pid,%cpu,%mem,cmd --sort=-%cpu | head

๐Ÿ“Œ Step 7: Look Into Specific Services

Apache/LiteSpeed:

apachectl fullstatus

or if using LiteSpeed:

/usr/local/lsws/bin/lshttpd -V

MySQL/MariaDB:

mysqladmin processlist
mysqladmin extended-status

โš ๏ธ Step 8: Check for Exhausted Resources

  • Memory: free -m or top
  • Disk Space: df -h
  • Inodes: df -i
  • Swap: swapon -s and free -m

๐Ÿงฐ Optional: Use sar to Review Historical Stats

Install sysstat if not already:

yum install sysstat -y

Run:

sar -u 1 10   # CPU usage
sar -r 1 10   # Memory
sar -b 1 10   # I/O

๐Ÿงผ Step 9: Mitigate and Optimize

Depending on your findings, you can:

  • Restart runaway services (systemctl restart apache2, systemctl restart mysql, etc.)
  • Limit abusive users or scripts
  • Tune Apache/MySQL configuration
  • Add swap or upgrade server resources

โœ… Conclusion

By systematically using tools like uptime, top, vmstat, iostat, and ps, you can pinpoint the source of high load and apply targeted solutions. These commands are invaluable for real-time diagnostics and trend analysis on any Linux-based cPanel server

Scroll to Top