This article is a mirror article of machine translation, please click here to jump to the original article.

View: 1067|Reply: 1

[Linux] sysstat tutorial for Linux system performance monitoring tools

[Copy link]
Posted on 9/25/2025 10:41:14 AM | | | |
Requirements: I bought a lightweight cloud server in Alibaba Cloud, sometimes the CPU is 100% and the remote cannot be connected, and I don't know what happened, and it returns to normal after restarting or waiting for a period of time. You can use sysstat to collect system conditions regularly (some images of Alibaba Cloud are already installed built-in).
Linux deploys the Netdata performance monitoring tool using Docker
https://www.itsvse.com/thread-10824-1-1.html

sysstat

Official Website:The hyperlink login is visible.
Source:The hyperlink login is visible.
Frequently asked questions:The hyperlink login is visible.

The sysstat software package contains a variety of utilities commonly used by commercial Unix to monitor system performance and usage activities:

  • iostat reports CPU stats and input/output statistics for block devices and partitions.
  • mpstat reports individual or combined processor-related statistics.
  • pidstat reports statistics for Linux tasks (processes): I/O, CPU, memory, etc.
  • tapestat reports statistics on tape drives connected to the system.
  • cifsiostat reports CIFS statistics.


Sysstat also contains tools that you can schedule via cron or systemd to collect and record the history of performance and activity data:

  • SAR collects, reports, and saves system activity information (see the list of metrics collected by SAR below).
  • SADC is a system activity data collector that serves as a backend for SAR.
  • SA1 collects binary data and stores it in a system activity daily data file. It is the frontend of SADC and is designed to run via cron or systemd.
  • SA2 generates a daily activity summary report. It is the frontend of SAR and is designed to run via cron or systemd.
  • SADF displays data collected by SAR in a variety of formats (CSV, XML, JSON, etc.) and can be used to exchange data with other programs. This command can also be used to graph the various activities collected by SAR using SVG (Scalable Vector Graphics) format.


The default sampling interval is 10 minutes, but of course it can be changed (it can be as small as 1 second).

Installation tutorial

In the case of Rocky Linux 9, the installation command is as follows:

Configuration file: /etc/sysconfig/sysstat
Collection frequency: systemctl cat sysstat-collect.timer
Collection directory: /var/log/sa

View specific metrics

CPU Usage:
sar -u -f /var/log/sa/sa05
Memory Usage:
sar -r -f /var/log/sa/sa05
Swap partition usage:
sar -S -f /var/log/sa/sa05
I/O Usage:
sar -b -f /var/log/sa/sa05
Network Interface Statistics (RX/TX):
sar -n DEV -f /var/log/sa/sa05
Context switching and process creation per second:
sar -w -f /var/log/sa/sa05



Use crontab to call pidstat to collect process information with the following command:

Note: YesWith logrotate cut logsOutline.

Reference:The hyperlink login is visible.




Previous:Stratum V1, V2 cryptocurrency network communicates with the pool protocol
Next:Git syncs the primary repository branch code to the private repository branch
 Landlord| Posted on16 seconds ago |
1、sysstatThe data obtained by the service reflects the overall system performance. The sysstat data file is read through the sar command and results are more user-friendly and easy to understand;

2. AndatopTools, yesBreak down performance data down to each process, The analysis results of atop are quite dynamic, similar to executing top directly. It can sort by CPU and memory status, and can also perform regular matching. Aposar, on the other hand, is more similar to the output of the SAR tool.

3、OSWatchThe tool is based on commonly used tools like sysstat, PS, and TOP, further developed and packaged using shell scripts. Of course, the output is quite user-friendly; after installing the tar package and extracting it, it can be used, allowing executable programs and results to be stored anywhere. It also supports compressing output content by calling the gzip command.

4、nmonThe output from the tool feels rather messy (not in real-time mode), and processing the output files by checking them is inconvenient. However, after extracting the data, combining it with Excel Output is more user-friendly and requires relatively low skill level. Anyone can simply click the macro button in Excel to generate a beautiful trend chart.

Therefore, when encountering system problem localization and analysis, it can be used together. Based on current user experience, the above tools do not occupy much of the system. On important nodes in a company, besides deploying tools like Zabbix and Nagios, you can also deploy OSWATCH and Atop tools to facilitate combined analysis after problems arise. You can use the former to view trend charts, while the latter for text data comparison.
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com