{{tag>PUB Perf}}
= Notes sysstat sar
Voir :
* https://www.linuxjournal.com/content/how-use-sar-system-activity-reporter
Voir aussi :
* [[notes atop]]
* nmon
== Install
apt-get update
apt-get install sysstat
''/etc/default/sysstat''
ENABLED="true"
# service sysstat restart
Starting the system activity data collector: sadc.
== Utilisation
$ dpkg -L sysstat |grep 'bin/'
/usr/bin/nfsiostat
/usr/bin/pidstat
/usr/bin/sadf
/usr/bin/iostat
/usr/bin/mpstat
/usr/bin/sar.sysstat
/usr/bin/cifsiostat
Report CPU utilization
sar -u ALL
Report per-processor CPU utilization
sar -P ALL
Display all CPU utilization per 2 seconds 3 times
mpstat -P ALL 2 3
# mpstat -A 1
Report memory utilization
sar -r ALL
Report swap space utilization
sar -S
Report hugepages utilization
sar -H
Report paging statistics
sar -B
Report swapping statistics
sar -W
Report I/O and transfer rate statistics
sar -b
Report block device activity
sar -d
Report process creation and system switching activity
sar -w
Report queue length and load averages
sar -q
Display I/O disk with Mega bytes per 2 seconds
iostat -mx -d 2
Report network utilization
sar -n ALL
Display I/O and network per 2 seconds 5 times
sar -b -n DEV 2 5
Display data in human readable way
sar -r -h
Display memory utilization of specific process per a second 3 times
pidstat -r -p 21090 1 3
Charge sur une période donnée
sar -q -f /var/log/sa/sa27 -s 16:00:00 -e 17:00:00
sar -A -f /var/log/sa/sa27 -s 16:00:00 -e 17:00:00
Un peu de couleurs
env S_COLORS=always sar -A | less -R -S
env S_COLORS=always sar -n DEV | grep --color=never eth0
Voir aussi :
* dircolors
=== Autres
Réseaux
sar -n ALL
sar -n DEV
sar -n TCP
sar -n ETCP
sar -n IP
sar -n EIP
Disques
iostat -p -x
== Configuration
=== Timer
# systemctl edit --full sysstat-collect.timer
systemctl cat sysstat-collect.timer
''/usr/lib/systemd/system/sysstat-collect.timer''
# /usr/lib/systemd/system/sysstat-collect.timer
# (C) 2014 Tomasz Torcz
#
# sysstat-11.7.3 systemd unit file:
# Activates activity collector every 10 minutes
[Unit]
Description=Run system activity accounting tool every 10 minutes
[Timer]
OnCalendar=*:00/10
[Install]
WantedBy=sysstat.service
systemctl edit sysstat-collect.timer
''/etc/systemd/system/sysstat-collect.timer.d/override.conf''
[Unit]
Description=Run system activity accounting tool every 5 minutes
[Timer]
OnCalendar=
OnCalendar=*:5/5
== Pb
# sar -n TCP
Requested activities not available in file /var/log/sa/sa31
''/etc/sysconfig/sysstat''
# Parameters for the system activity data collector (see sadc(8) manual page)
# which are used for the generation of log files.
# By default contains the `-S DISK' option responsible for generating disk
# statisitcs. Use `-S XALL' to collect all available statistics.
SADC_OPTIONS="-S XALL"
Important note: The activities (including optional ones) saved in an existing data file prevail over those selected with option -S. As a consequence, appending data to an existing data file will result in option -S being ignored.