Part of Datorkirurgen AB – IT experts across Sweden

High server load makes websites slow, applications unresponsive and users frustrated. Business IT Support finds the cause on Linux servers with top, vmstat, iostat and the logs, and we fix it rather than only restarting the server.

Reading top correctly

The command top shows the load average, CPU use, memory and the processes that use the most resources. The load average shows how many processes want to run, measured over 1, 5 and 15 minutes. A value higher than the number of CPU cores over time means that the server cannot keep up.

However, high load does not always mean a busy CPU. For example, a high wa value shows that processes wait for the disk, while high st on a virtual machine means that the host steals CPU time. Therefore, we read every field before we draw conclusions.

The top command showing high server load on Linux
The command top showing the server load. For example, this is how Business IT Support, part of Datorkirurgen AB, starts the analysis.

Further with vmstat, iostat and logs

Next, vmstat shows memory, swap and CPU over time, which reveals whether the server runs out of memory and starts swapping. In addition, iostat shows the load on each disk, and ss or netstat shows network connections.

The logs complete the picture. For instance, the web server access log often shows a burst of requests from bots or an attack against the login page. Moreover, monitoring such as CloudWatch shows when the load started and whether it follows a pattern.

CloudWatch alarm for CPU usage during high server load
CloudWatch alarm for CPU usage on an EC2 server. For example, the alarm shows when the load started.

Common causes of high server load

In our experience, the most common causes are aggressive bots and crawlers, attacks against WordPress login and xmlrpc.php, heavy database queries, too many PHP-FPM workers for the available memory and backups that run during office hours. Malware that sends spam or mines cryptocurrency also appears regularly.

Sometimes the server is simply too small for the current traffic. In that case, a larger instance or better caching gives more effect than any tuning.

Moreover, scheduled jobs such as cron tasks, log rotation and antivirus scans can collide with peak hours. Therefore, we check the crontab and the system timers whenever the load rises at the same time every day.

Details for an alarm in AWS CloudWatch
Details for an alarm in AWS CloudWatch. An example from a real assignment, where the load followed a clear pattern.

From diagnosis to action against high server load

Once we know the cause, we act on it. For example, we block abusive bots, protect the login with rate limits, add indexes to slow queries, adjust PHP-FPM to the available memory or move backups to night time. Then we verify that the load drops.

Finally, we set up alerts and document the change. As a result, the next spike becomes visible early, and the server stays responsive for the users.

Server racks in a server room
Server racks in a server room. Correct troubleshooting of high server load saves both time and hardware.
Editing php.ini and checking PHP-FPM settings on Amazon Linux
Editing php.ini and checking php-fpm. PHP-FPM settings must match the available memory.

Contact Datorkirurgen AB about high server load

Business IT Support is part of Datorkirurgen AB, which has more than 30 years of experience in IT for businesses. We troubleshoot high server load on Linux servers in AWS, Azure and on premises for companies remotely anywhere, and on site in Stockholm and across Sweden.

In addition, our prices start at €250 per hour excluding VAT, or as agreed, and we guarantee to solve the problem. The manual page for top explains every field on man7.org. Contact us when your server slows down.

Frequently asked questions about high server load

Basic questions

Causes and actions

Monitoring and support

Website developed by Datorkirurgen AB · Privacy policy