What causes high server load? How to identify the part that is under load

My name is Ito and I am an infrastructure engineer

In our previous post, we introduced "load average," a metric used to check when server load increases.
Checking Server Load with Load Average - Beyond Blog

Load average represents the number of processes waiting to be processed.
The higher the number, the more processes are waiting to be processed, indicating a "high load" situation.

This time, I would like to explore the causes of high load situations

There are two main reasons for this:

There are basically two main reasons why a high load average occurs

  • CPU processing cannot keep up
  • Disk I/O processing cannot keep up

Now, I would like to explain how to find the cause of each of these

If the CPU is the cause

First, check the CPU usage using the top command. The following two values ​​are important:

%user CPU usage by user processes
%system CPU usage by the system (kernel)

If a typical process is CPU intensive, you will likely see high CPU usage in user mode (%user)

Furthermore, user-mode processes, especially those running a large number of processes, perform process switching.
This "process switching" utilizes kernel-mode (%system) CPU resources, so
programs that frequently switch processes will likely have high kernel-mode CPU usage.

stress-user_022516_092215_PM
High user mode CPU usage

stress-system_022516_092244_PM
High kernel CPU usage

If the cause is disk I/O

If disk I/O is the problem, check the following in top:

%iowait The process is idle when disk I/O is required
SWAP The amount of memory used up and the HDD is being used instead of memory

The iowait value often increases when there are large amounts of data being read from and written to the disk.
For example, a database server that frequently accesses the database will likely have a high iowait value.

SWAP is the amount of hard drive space used as backup memory when a process has used up all of its memory.
An example of using SWAP is a web server, which may allocate memory and use SWAP when there is a large number of accesses.

When using SWAP, the server will be slower because the HDD is used instead of memory, which increases the load on disk I/O

stress-disk_022516_092255_PM
High iowait and high load due to disk I/O

stress-swap
If you are using SWAP

We will investigate the cause

This should help you determine whether the problem is CPU-related or I/O-related. You
can then use commands like `ps` to find out which processes are using the CPU (or memory in the case of SWAP).

If the CPU usage is high in user mode, and there are no issues with I/O, then you
may need to either increase the CPU's performance or revise the program.

If there is a problem with the disk I/O, you may need to add more memory or review the program to perform processing in a location with available memory rather than using disk I/O

Additionally, you might experience slow processing even with a low load average.
In such cases, the issue could be related to software settings or network processing.

When you are faced with the problem of "high load," the first step to solving it is to stay calm and identify which part is under load

If you want to talk to a cloud professional

Since our founding, Beyond has used the technical capabilities we have cultivated as a multi-cloud integrator and managed service provider (MSP) to design, build, and migrate systems using a variety of cloud server platforms, including AWS, GCP, Azure, and Oracle Cloud

We provide a custom-made cloud server environment optimized for our customers based on the specifications and functions of the systems and applications they require, so if you are interested in the cloud, please feel free to contact us

● Cloud/Server design and construction
● Cloud/Server migration
● Cloud/Server operation, maintenance, and monitoring (24 hours a day, 365 days a year)

If you found this article helpful,please give it a "Like"!
4
Loading...
4 votes, average: 1.00 / 14
17,018
X Facebook Hatena Bookmark pocket

The person who wrote this article

About the author