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.