Find out who is monopolizing or eating the CPUs


Symtom: To find which process or application which chokes CPU usage.

Solution: Following command will displays the top 10 CPU users on the Linux system.

# ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10

or  

# ps -eo pcpu,pid,user,args | sort -r -k1 | less

Output:

%CPU   PID    USER       COMMAND
  96       2148   vivek      /usr/lib/vmware/bin/vmware-vmx -C /var/lib/vmware/Virtual Machines/Ubuntu 64-bit/Ubuntu 64-bit.vmx -@ “”
0.7       3358  mysql       /usr/libexec/mysqld –defaults-file=/etc/my.cnf –basedir=/usr –datadir=/var/lib/mysql –user=mysql –pid-file=/var/run/mysqld/mysqld.pid –skip-locking –socket=/var/lib/mysql/mysql.sock
0.4      29129  lighttpd    /usr/bin/php
0.4      29128  lighttpd    /usr/bin/php
0.4      29127  lighttpd    /usr/bin/php
0.4      29126   lighttpd    /usr/bin/php
0.2      2177     vivek         [vmware-rtc]
0.0      9              root     [kacpid]
0.0      8              root     [khelper]

Ref: http://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html

 

 

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: