\CMD
: run CMD in a sub-shell? (useful for not using .bashrc or .zshrc which might have alias)
press 1
: toggle list cpu usage by cores (useful for understanding load average and io wait)<
and>
: sort with prev or next colume (starts from cpu)f
(field): add or remove column, in top view,press W
to save view to~/.toprc
- if see high
cpu wait
, time to debug disk press ?
: list of available options
press E/e
to zoom out the memory scale: KB -> MB -> GBVIRT
: virtual memory reserved, this should be large, but not actually all used (32TB in total for 64-bit OS)RES
: resident memory is the real allocated memory
iostat 2 (sec interval) 5 (loop)
- first output gives you a summary of usage since startup
- the rest gives summary of interval
- which process is hogging my disk
free -m
: in MB- total = used + free + cache/buffer
- available: free + can be clear cached.
- swap
swapon -s
: which partition used for swap
- support polling in interval
- cron job in
/etc/cron.d/sysstat
- logs in
/var/log/sa
- configuration in
/etc/sysconfig/sysstat
LANG=C sar
: setLANG=C
to use 24H instead ofAM/PM
-b
: IO (tps: transcation per sec, bread/s: block read per sec)-P CPU_NUM
: CPU information-n dev
: network (IFACE: interface, rxpck/s: received packet per sec, txpck/s: transmitted packet per sec)