Sar

From HPCWIKI
Revision as of 15:15, 18 June 2023 by Admin (talk | contribs) (Created page with "Monitoring server resources is a crucial part of identifying any bottlenecks and possible issues on your server. The <code>sar</code> command allows you to capture the utilization of your resources like RAM, CPU, Disk I/O and etc on Ubuntu, sar can be installed by $sudo apt install sysstat == sar system service == sar can be run as system service # sudo systemctl start sysstat # sudo systemctl enable sysstat # This will add the required cron jobs so that the system...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Monitoring server resources is a crucial part of identifying any bottlenecks and possible issues on your server. The sar command allows you to capture the utilization of your resources like RAM, CPU, Disk I/O and etc

on Ubuntu, sar can be installed by

$sudo apt install sysstat

sar system service

sar can be run as system service

  1. sudo systemctl start sysstat
  2. sudo systemctl enable sysstat
  3. This will add the required cron jobs so that the system data is collected accordingly. The cron jobs will be added at cat /etc/cron.d/sysstat

Command and options

sar has a lot of arguments and options,

Options Description
sar -u 2 30 -u for all CPU,

2 means that the sar command should run every 2 seconds 30 means that the command should be executed 30 times.

sar -r 2 30 -r for memory
sar -n DEV 4 -n for network interfaces,

4 means that the sar command should run every 2 seconds

References