Skip to content

Instantly share code, notes, and snippets.

@nicokosi
Last active December 8, 2016 12:19
Show Gist options
  • Save nicokosi/9814d6c526cec4b73882 to your computer and use it in GitHub Desktop.
Save nicokosi/9814d6c526cec4b73882 to your computer and use it in GitHub Desktop.
Some examples of Linux performance command lines as demonstrated by Brendan Gregg in video "Linux Performance Tools":http://techblog.netflix.com/2015/08/netflix-at-velocity-2015-linux.html
# CPU & mem usage per process (sampling)
top # list processes
top -h # list threads
top -c # show full command line
htop
# CPU usage per CPU:
mpstat -P ALL 1
# Processes (uptime, hierarchy, CPU usage, etc...):
ps
ps -ef f # "ascii art forest"
ps -eo user,sz,rss,minflt,majflt,pcpu,args # Custom fields (including user, CPU, etc...)
# Memory usage (+ global CPU usage)
vmstat 1 # lists all "runnable tasks" that may not be running
# Used/free memory
free -mh
# I/O usage (sampling):
iostat -xmdz 1 # read/write usage & queuing (but no errors)
# network I/O (sampling):
sar -n DEV 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment