[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

How to find the cause of server load

My name is Ito and I am an infrastructure engineer.

Last time, I introduced something called "load average" that is checked when the server load increases.
Check the server load with load average? Beyond Blog

Load average is a representation of processes waiting to be processed.
The higher the number, the more processes are waiting for processing, and the situation is "higher load."

Why is the load so high this time? I would like to find out the cause.

There are two main causes

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 out if each is the cause.

If the cause is the CPU

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

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

If a general process is CPU intensive, the user mode (%user) CPU usage will probably be high.

Also, if a large number of processes are running in user mode, the process will be switched.
Since the kernel mode (%system) CPU is used when performing this "process switching",
the kernel mode CPU usage rate will be high for programs that often switch processes.

stress-user_022516_092215_PM
If user mode CPU usage is high

stress-system_022516_092244_PM
If kernel CPU usage is high

If disk I/O is the cause

If disk I/O is the cause, check the following at top.

%iowait Processes are idle when disk I/O is required
SWAP Amount of memory used up and HDD used instead of memory

The iowait value is often high when a large amount of data is being read and written from disk.
For example, a DB server that accesses a lot of databases tends to have a high iowait value.

SWAP is the capacity of the HDD used in place of memory when a process uses all of the memory.
An example of using SWAP is when a web server receives a large amount of access, allocating memory and using SWAP.

When using SWAP, using HDD instead of memory = increased load due to disk I/O, which slows down the server speed.

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

stress-swap
If you are using SWAP

I will investigate

I think this will help you figure out whether the problem is caused by the CPU or I/O.
Furthermore, we will use the ps command to find out which processes are using the CPU (in the case of SWAP, which processes are using memory).

If the CPU usage rate in user mode is high, there is no problem with I/O, etc.,
so you may need to increase CPU performance or review the program.


it may be necessary to expand the memory or

Also, there may be cases where the load average is low but the processing is slow.
In that case, there may be a problem with the software settings or network processing.

When faced with the problem of "high load,"
the first step to solving the problem is to calm down and identify where the load is being placed.

If you found this article helpful , please give it a like!
4
Loading...
4 votes, average: 1.00 / 14
14,966
X facebook Hatena Bookmark pocket
[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

The person who wrote this article

About the author