[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”

Investigate the status of each resource on the server with sysstat

What is sysstat?

A monitoring tool for analyzing the load on Linux servers .
You can investigate CPU load, disk I/O usage, memory usage, and network device status.

The sysstat package contains the following commands:
sar・sadc・sadf・iostat・tapestat・cifsiostat・mpstat・pidstat

Let's install it.
You can install it by running the following command:

# yum install sysstat
# rpm -qa | grep sysstat
sysstat-9.0.4-27.10.amzn1.x86_64

The package is displayed, so it can be installed.
Now let's actually execute each command.

sar

This command allows you to check the operating status of the system.

# sar [option] Acquisition interval Acquisition count

The first time I ran it without any options, the results were displayed in 10 minute increments.

The second time I executed it to display the iowait status 3 times for 10 seconds.
Similar to the first execution result, the last line displays the average value during command execution.

You can also check the CPULA status and memory usage status by specifying options.

# Check CPULA status sar -q # Check memory usage sar -r

vmstat

This command allows you to check memory, SWAP, disk I/O, and CPU usage.

# vmstat [option] Acquisition interval Acquisition count

The resource status is displayed 3 times per second by adding the "-t" option to display the acquisition time.

mpstat

This command allows you to check the CPU usage status.

# mpstat [option] Acquisition interval Acquisition count

Compared to the sar and top commands, each CPU processing time is displayed for %irq (hardware interrupt), %soft (software interrupt CPU), %guest (virtual server execution CPU), etc.

At the end

If a problem or failure occurs on the server, you
can also check the resource status using the top command or ps command.
check the server load using load average
to find the cause of server load

If you want to know the normal load status and long-term resource status, a monitoring tool like Zabbix is ​​suitable.
However, this time we introduced sysstat as one of the investigation methods when a failure occurs.

If you install sysstat, you can execute various commands, including those introduced here.
Please check the resource status by using it together with commands that put a load on the server, and
try various combinations of options.
Thank you for reading this far.

If you found this article helpful , please give it a like!
1
Loading...
1 vote, average: 1.00 / 11
3,618
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

Sakina Nakagawa

I joined the company in 2016 as a new graduate. Lately, I've been having fun learning the basics of servers.