iostat (cpu and block device info)
mpstat (processor related statistics)
pidstat(cpu, memory, io, scheduling, stack, task switching)
tapestat (statistics for tape drives)
cifsiostat (CIFS statistics)
sar (collect and historize performance and activity)
sh$ sudo apt install sysstat
sh$ sudo yum install sysstat
sh$ sudo pacman -Sy sysstat
displays statistics about cpu and block devices
Display statistics since last boot
sh# iostat
Linux 4.14.98-v7+ (rh-1) 03/18/19 _armv7l_ (4 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
0.21 0.04 0.13 0.03 0.00 99.60
Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
mmcblk0 37.68 631.95 1219.57 1182369 2281812
CPU info
user
nice
system
iowait
steal
idle
Block Device info
tps (transfer per second)
a transfer is an i/o request to the device
kB_read/s (data read last second in kiloBytes)
kB_wrtn/s (data written last second in kiloBytes)
kB_read (data read since last boot in kiloBytes)
kB_wrtn (data written since last boot in kiloBytes)
Display statistics in MegaBytes
sh# iostat -m
Linux 4.14.98-v7+ (rh-1) 03/18/19 _armv7l_ (4 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
0.21 0.04 0.13 0.03 0.00 99.60
Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtn
mmcblk0 36.49 0.60 1.15 1154 2228
Display statistics of specific block device (and all their partitions) only
sh# iostat -p mmcblk0
Linux 4.14.98-v7+ (rh-1) 03/18/19 _armv7l_ (4 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
0.21 0.04 0.13 0.03 0.00 99.60
Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
mmcblk0 29.71 497.85 960.90 1182401 2282148
mmcblk0p2 0.00 0.00 0.00 5 0
mmcblk0p7 29.63 495.92 960.90 1177821 2282144
mmcblk0p5 0.01 0.13 0.00 297 0
mmcblk0p1 0.01 0.13 0.00 304 0
mmcblk0p6 0.05 1.44 0.00 3430 4
Display extended statistics
sh# iostat -x -p mmcblk0Linux 4.14.98-v7+ (web-1) 03/18/19 _armv7l_ (4 CPU)report statistics for linux tasks (active linux processes)
Display cpu statistics about all active processes. Same as -p ALL.
sh# pidstat
Linux 4.14.98-v7+ (web-1) 03/19/19 _armv7l_ (4 CPU)
01:06:08 UID PID %usr %system %guest %wait %CPU CPU Command
01:06:08 0 1 0.01 0.00 0.00 0.00 0.01 2 systemd
01:06:08 0 38 0.00 0.00 0.00 0.00 0.00 2 systemd-journal
01:06:08 981 44 0.00 0.00 0.00 0.00 0.00 0 systemd-network
01:06:08 81 48 0.00 0.00 0.00 0.00 0.00 2 dbus-daemon
01:06:08 0 49 0.00 0.00 0.00 0.00 0.00 3 systemd-logind
01:06:08 980 50 0.00 0.00 0.00 0.00 0.00 0 systemd-resolve
01:06:08 0 53 0.00 0.00 0.00 0.00 0.00 0 login
01:06:08 0 55 0.00 0.00 0.00 0.00 0.00 0 agetty
01:06:08 0 56 0.00 0.00 0.00 0.00 0.00 0 agetty
01:06:08 0 57 0.00 0.00 0.00 0.00 0.00 3 agetty
01:06:08 0 58 0.00 0.00 0.00 0.00 0.00 2 agetty
01:06:08 0 151 0.00 0.00 0.00 0.00 0.00 1 sshd
01:06:08 0 438 0.00 0.00 0.00 0.00 0.01 2 httpd
01:06:08 33 439 0.00 0.00 0.00 0.00 0.00 1 httpd
01:06:08 33 440 0.00 0.00 0.00 0.00 0.00 2 httpd
01:06:08 33 523 0.00 0.00 0.00 0.00 0.00 2 httpd
01:06:08 0 925 0.00 0.00 0.00 0.00 0.00 0 login
01:06:08 1001 10304 0.00 0.00 0.00 0.00 0.00 1 systemd
01:06:08 1001 10310 0.00 0.00 0.00 0.00 0.00 3 bash
01:06:08 0 10312 0.00 0.00 0.00 0.00 0.00 2 sudo
01:06:08 0 10313 0.00 0.00 0.00 0.00 0.00 1 bash
01:06:08 1001 10599 0.00 0.00 0.00 0.00 0.00 1 bash
01:06:08 0 10651 0.00 0.00 0.00 0.00 0.00 3 sudo
01:06:08 0 10653 0.00 0.00 0.00 0.00 0.00 1 bash
01:06:08 0 10925 0.00 0.00 0.00 0.00 0.00 3 pidstat
io statistics
cpu statistics
memory and cache statistics
stack
task switching
Display io statistics
sh# pidstat -d
Linux 4.14.98-v7+ (web-1) 03/19/19 _armv7l_ (4 CPU)
01:09:37 UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
01:09:37 0 1 5.01 1.23 0.01 18 systemd
01:09:37 0 38 0.00 0.17 0.00 10 systemd-journal
01:09:37 0 53 0.00 0.00 0.00 2 login
01:09:37 0 55 0.00 0.00 0.00 0 agetty
01:09:37 0 151 0.00 0.00 0.00 0 sshd
01:09:37 0 438 0.00 0.00 0.00 0 httpd
01:09:37 33 439 0.00 0.00 0.00 0 httpd
01:09:37 33 440 0.00 0.00 0.00 0 httpd
01:09:37 0 925 0.00 0.00 0.00 1 login
01:09:37 1001 10304 0.00 0.00 0.00 0 systemd
01:09:37 1001 10310 0.00 0.00 0.00 0 bash
01:09:37 0 10312 0.00 0.00 0.00 0 sudo
01:09:37 0 10313 0.00 0.07 0.00 0 bash
01:09:37 1001 10599 0.02 0.00 0.00 0 bash
01:09:37 0 10653 0.10 1.30 0.00 0 bash
Display scheduling statistics
sh# pidstat -R
Linux 4.14.98-v7+ (web-1) 03/19/19 _armv7l_ (4 CPU)
01:10:51 UID PID prio policy Command
Display memory and cache statistics
sh# pidstat -r
Linux 4.14.98-v7+ (web-1) 03/19/19 _armv7l_ (4 CPU)
01:12:19 UID PID minflt/s majflt/s VSZ RSS %MEM Command
01:12:19 0 1 0.11 0.00 33752 7916 0.83 systemd
01:12:19 0 38 0.07 0.00 46220 14112 1.49 systemd-journal
01:12:19 981 44 0.01 0.00 22052 5680 0.60 systemd-network
01:12:19 81 48 0.01 0.00 6324 3132 0.33 dbus-daemon
01:12:19 0 49 0.01 0.00 13564 5224 0.55 systemd-logind
01:12:19 980 50 0.01 0.00 17840 6020 0.63 systemd-resolve
01:12:19 0 53 0.00 0.00 7348 2984 0.31 login
01:12:19 0 54 0.00 0.00 1940 1344 0.14 agetty
01:12:19 0 55 0.00 0.00 1940 1408 0.15 agetty
01:12:19 0 56 0.00 0.00 1940 1344 0.14 agetty
01:12:19 0 57 0.00 0.00 1940 1272 0.13 agetty
01:12:19 0 58 0.00 0.00 1940 1268 0.13 agetty
01:12:19 0 151 0.00 0.00 7404 4540 0.48 sshd
01:12:19 0 438 0.01 0.00 7236 3524 0.37 httpd
01:12:19 33 439 0.00 0.00 236584 3412 0.36 httpd
01:12:19 33 440 0.01 0.00 236584 3444 0.36 httpd
01:12:19 33 441 0.00 0.00 236584 3316 0.35 httpd
01:12:19 33 523 0.00 0.00 236584 3316 0.35 httpd
01:12:19 0 925 0.00 0.00 7156 2836 0.30 login
01:12:19 1001 10304 0.01 0.00 14844 6868 0.72 systemd
01:12:19 1001 10305 0.00 0.00 38452 1852 0.20 (sd-pam)
01:12:19 1001 10310 0.00 0.00 3632 2872 0.30 bash
01:12:19 0 10312 0.00 0.00 11252 4520 0.48 sudo
01:12:19 0 10313 0.00 0.00 3632 2848 0.30 bash
01:12:19 1001 10599 0.00 0.00 3632 2836 0.30 bash
01:12:19 0 10651 0.00 0.00 11252 4444 0.47 sudo
01:12:19 0 10653 0.01 0.00 3632 2844 0.30 bash
01:12:19 0 10968 0.00 0.00 5012 348 0.04 pidstat
Display Stack statistics
sh# pidstat -s
Linux 4.14.98-v7+ (web-1) 03/19/19 _armv7l_ (4 CPU)
01:42:42 UID PID StkSize StkRef Command
01:42:42 0 1 1028 20 systemd
01:42:42 0 38 132 8 systemd-journal
01:42:42 981 44 132 4 systemd-network
01:42:42 81 48 132 8 dbus-daemon
01:42:42 0 49 132 8 systemd-logind
01:42:42 980 50 132 8 systemd-resolve
01:42:42 0 53 132 20 login
01:42:42 0 54 132 4 agetty
01:42:42 0 55 132 4 agetty
01:42:42 0 56 132 4 agetty
01:42:42 0 57 132 4 agetty
01:42:42 0 58 132 4 agetty
01:42:42 0 151 132 8 sshd
01:42:42 0 438 132 4 httpd
01:42:42 33 439 132 4 httpd
01:42:42 33 440 132 4 httpd
01:42:42 33 441 132 4 httpd
01:42:42 33 523 132 8 httpd
01:42:42 0 925 132 16 login
01:42:42 1001 10304 132 16 systemd
01:42:42 1001 10305 1028 4 (sd-pam)
01:42:42 1001 10310 132 28 bash
01:42:42 0 10312 132 20 sudo
01:42:42 0 10313 132 28 bash
01:42:42 1001 10599 132 32 bash
01:42:42 0 10651 132 20 sudo
01:42:42 0 10653 132 32 bash
01:42:42 0 11013 132 12 pidstat
Display task switching activity
sh# pidstat -w
Linux 4.14.98-v7+ (web-1) 03/19/19 _armv7l_ (4 CPU)
01:44:01 UID PID cswch/s nvcswch/s Command
01:44:01 0 1 0.04 0.01 systemd
01:44:01 0 38 0.02 0.00 systemd-journal
01:44:01 981 44 0.01 0.00 systemd-network
01:44:01 81 48 0.01 0.01 dbus-daemon
01:44:01 0 49 0.03 0.00 systemd-logind
01:44:01 980 50 0.01 0.00 systemd-resolve
01:44:01 0 53 0.00 0.00 login
01:44:01 0 54 0.00 0.00 agetty
01:44:01 0 55 0.00 0.00 agetty
01:44:01 0 56 0.00 0.00 agetty
01:44:01 0 57 0.00 0.00 agetty
01:44:01 0 58 0.00 0.00 agetty
01:44:01 0 151 0.00 0.00 sshd
01:44:01 0 438 0.89 0.00 httpd
01:44:01 33 439 0.00 0.00 httpd
01:44:01 33 440 0.00 0.00 httpd
01:44:01 33 441 0.00 0.00 httpd
01:44:01 33 523 0.00 0.00 httpd
01:44:01 0 925 0.00 0.00 login
01:44:01 1001 10304 0.00 0.00 systemd
01:44:01 1001 10305 0.00 0.00 (sd-pam)
01:44:01 1001 10310 0.00 0.00 bash
01:44:01 0 10312 0.00 0.00 sudo
01:44:01 0 10313 0.00 0.00 bash
01:44:01 1001 10599 0.00 0.00 bash
01:44:01 0 10651 0.00 0.00 sudo
01:44:01 0 10653 0.01 0.00 bash
01:44:01 0 11034 0.00 0.00 pidstat