It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In RegisterIt looks like you're new here. If you want to get involved, click one of these buttons!
Sysstat is a versatile utility for monitoring and analyzing system performance. It provides detailed insights into various performance metrics, helping users identify potential bottlenecks and optimize system resources effectively.
In this guide we will install sysstat on Ubuntu/Debian and AlmaLinux/RockyLinux 9.
On Ubuntu/Debian, run the following command:
apt update && apt upgrade -y
On RedHat-based distributions, run this command to update the system:
dnf update && dnf upgrade -y
To install Sysstat, run the following command on Ubuntu/Debian
apt install sysstat -y
On RedHat distributions, run this command:
dnf install sysstat -y
Run these commands to start and enable sysstat:
systemctl start sysstat
systemctl enable sysstat
On Ubuntu and Debian, you need to enable data collection. To do this, navigate to the configurations file and edit it. Open the configurations file with your preferred text editor (in this example we are using vi):
vi /etc/default/sysstat
Then, find this line:
ENABLED="false"
Change "false" to "true".
Save the file and exit (press "Esc", then type :wq and click "Enter").
After that restart sysstat:
systemctl restart sysstat
Verify installation and check the installed sysstat version by running this command:
sar -V
You also can check the status of the sysstat:
systemctl status sysstat
You can now use tools like iostat
, mpstat
, pidstat
, sar.
Command iostat
provides Input/Output statistics:
iostat
iostat output includes:
CPU Metrics (avg-cpu):
%user: Time the CPU spends executing user processes.
%system: Time spent on system-level (kernel) operations.
%iowait: Time the CPU waits for I/O operations to complete.
%idle: Time the CPU remains idle, indicating there is unused capacity.
The CPU usage in this example is relatively low, with most time spent idle, while a small percentage is used by user processes (%user).
Disk Metrics:
Devices (loop0, sda):
sda: The main storage device.
tps: Transactions per second on the sda device.
kB_read/s: Read rate from the disk (kilobytes per second).
kB_wrtn/s: Write rate to the disk (kilobytes per second).
kB_read: Total kilobytes read since boot.
kB_wrtn: Total kilobytes written since boot.
mpstat
displays CPU usage statistics, either for all CPUs or per individual CPU core:
CPU Metrics:
Other fields such as %nice, %irq, and %soft indicate time spent on specific tasks (e.g., handling interrupts), which are negligible in this example.
The CPU column displays "all" to show aggregate statistics across all CPUs. If individual CPU data is needed, you can use:
mpstat -P ALL
pidstat
reports statistics for individual processes, including CPU, memory, and I/O usage:
Key Columns:
sar
collects, reports, and saves system activity statistics over time:
The sar command is often used to:
Most sysstat tools come with a built-in help option (-h or --help). For example:
iostat --help
You can run each sysstat command with this option to see detailed information.
In this guide, we've explored how to use the ssystat command to monitor the performance and health of your system. ssystat is a powerful tool that provides real-time statistics on various system resources, such as CPU usage, memory usage, disk I/O, and network activity, which can help you identify performance bottlenecks and optimize your system's overall efficiency.
By regularly monitoring the outputs of ssystat, you can stay up-to-date on your system's status and take proactive steps to resolve potential issues before they escalate.