Tuesday, September 13, 2011

Linux - system analysis/debugging

Useful for finding out bottlenecks -    disk/storage, CPU, memory, network

#top
#vmstat; vmstat -m; vmstat -a
# w username
# uptime
# ps -A; ps -Al
# ps -AlF; ps -AlFH; ps -AlLm
# ps ax; ps axu; ps axjf
# ps -ejH
# pstree
# ps -eo euser,ruser,suser,fuser,f,comm,label    ###show Security info
# ps axZ
# ps -eM
# ps -U -u u

Set Output In a User-Defined Format
# ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm
# ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm
# ps -eopid,tt,user,fname,tmout,f,wchan

Display Only The Process IDs of process-name
# ps -C process-name -o pid=
OR
# pgrep process-name

# ps -p -o comm=      ###show the Name of PID
# ps -auxf | sort -nr -k 4 | head -10    ###Top 10 Memory Consuming Process
# ps -auxf | sort -nr -k 3 | head -10    ###10 CPU Consuming Process
#free - Memory Usage

No comments: