Differences between revisions 11 and 12
Revision 11 as of 2023-03-31 15:49:46
Size: 3107
Comment:
Revision 12 as of 2023-03-31 15:52:42
Size: 3107
Comment:
Deletions are marked like this. Additions are marked like this.
Line 32: Line 32:
Technically is sar the program that collect the information but packagers decided to handle this throuhg sysstat name. Technically is sar the program that collect the information but packagers decided to handle this through sysstat name.

Translation(s): English - Español ~

(!) Discussion


About

sysstat contains the following system performance tools:

  • sar: collects and reports system activity information;
  • iostat: reports CPU utilization and disk I/O statistics;
  • tapestat: reports statistics for tapes connected to the system;
  • mpstat: reports global and per-processor statistics;
  • pidstat: reports statistics for Linux tasks (processes);
  • sadf: displays data collected by sar in various formats;
  • cifsiostat: reports I/O statistics for CIFS filesystems.

The statistics reported by sar deal with I/O transfer rates, paging activity, process-related activities, interrupts, network activity, memory and swap space utilization, CPU utilization, kernel activities and TTY statistics, among others. Both UP and SMP machines are fully supported.

Installation

apt-get install sysstat

Sar

Sar is set of tools that helps you to collect and report the system activity.

  • sar collects, reports and saves system activity information (see below a list of metrics collected by sar).
  • sadc is the system activity data collector, used as a backend for sar.
  • sa1 collects and stores binary data in the system activity daily data file. It is a front end to sadc designed to be run from cron or systemd.
  • sa2 writes a summarized daily activity report. It is a front end to sar designed to be run from cron or systemd.
  • sadf displays data collected by sar in multiple formats (CSV, XML, JSON, etc.) and can be used for data exchange with other programs. This command can also be used to draw graphs for the various activities collected by sar using SVG (Scalable Vector Graphics) format.

You can schedule via cron or systemd to collect and historize performance and activity data on Debian. Default sampling interval is 10 minutes but this can be changed of course (it can be as small as 1 second).

Enable Sar

Technically is sar the program that collect the information but packagers decided to handle this through sysstat name.

Once you install sysstat package edit the file /etc/default/sysstat and change the string ENABLED="false" to ENABLED="true".

After execute the following commands:

systemctl start sysstat
systemctl enable sysstat

You can check if sysstat or sar is running with the following command:

systemctl status sysstat

You can check if sar is storing the performance information on the following directory /var/log/sysstat, you will get a file with the format sa followed by a number that represents day of the month... for sample sa31.

Once the day is finished a process will convert that binary file to a text file that contains the information in a human readable form wit the name sar followed by a number that represents day of the month... for example sar30.