Skip to content

Instantly share code, notes, and snippets.

@dohsimpson
Last active September 24, 2017 13:33
Show Gist options
  • Save dohsimpson/21acfbf6de942913ab75284fdcaef798 to your computer and use it in GitHub Desktop.
Save dohsimpson/21acfbf6de942913ab75284fdcaef798 to your computer and use it in GitHub Desktop.
RHCE

Useful knowledge

Command Line

  • \CMD: run CMD in a sub-shell? (useful for not using .bashrc or .zshrc which might have alias)

System Performance Tools

top: general performance monitoring

  • 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

Mem

  • press E/e to zoom out the memory scale: KB -> MB -> GB
  • VIRT: 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: disk performance monitoring

  • iostat 2 (sec interval) 5 (loop)
  • first output gives you a summary of usage since startup
  • the rest gives summary of interval

iotop: disk usage per process

  • which process is hogging my disk

free: memory performance only

  • free -m: in MB
  • total = used + free + cache/buffer
  • available: free + can be clear cached.
  • swap

swapon: about swap

  • swapon -s: which partition used for swap

vmstat: virtual memory usage

  • support polling in interval

sar: performance history

  • cron job in /etc/cron.d/sysstat
  • logs in /var/log/sa
  • configuration in /etc/sysconfig/sysstat
  • LANG=C sar: set LANG=C to use 24H instead of AM/PM

arguments

  • -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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment