1

I have this output from top for the top 10 processes sorted by CPU usage descending:

top - 11:19:58 up  1:46,  2 users,  load average: 3.22, 3.48, 3.34
Tasks:  66 total,   5 running,  61 sleeping,   0 stopped,   0 zombie
Cpu(s): 77.5%us, 14.7%sy,  0.0%ni,  7.0%id,  0.9%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1048576k total,   299012k used,   749564k free,        0k buffers
Swap:        0k total,        0k used,        0k free,        0k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 7982 kenilwo   17   0  160m  53m  23m R  4.2  5.2   0:00.63 php
 7984 kenilwo   17   0  158m  51m  23m R  2.5  5.1   0:00.38 php
32245 mysql     15   0  214m  25m 4924 S  0.9  2.5   0:38.58 mysqld
32592 root      15   0 90724  26m  592 S  0.1  2.6   0:03.85 memcached
 1491 nobody    15   0 72336 3572 1656 S  0.1  0.3   0:00.43 httpd
 1495 nobody    15   0 72336 3560 1644 S  0.1  0.3   0:00.41 httpd
 1503 nobody    15   0 72200 3556 1656 S  0.1  0.3   0:00.43 httpd
 5992 root      15   0 12732 1264  956 R  0.1  0.1   0:01.80 top
32425 nobody    15   0 72192 3676 1784 S  0.1  0.4   0:00.47 httpd
32427 nobody    15   0 72332 3704 1784 S  0.1  0.4   0:00.44 httpd

What is odd is that it reports that 77.5% of the CPU resources are being used by user processes, yet, when I look at the top 10 processes, their usage is less than 10% (other processes on the system do not have CPU usage).

What's going on? What is purloining my CPU resources?

Tola Odejayi
  • 334
  • 1
  • 4
  • 19
  • Heh, nice load average. Somethings throttling your stuff. What distro are you running? Can you grab `htop` utility from your package manager? – Tim Dec 22 '11 at 19:37
  • @Tim, can you post your suggestion as an answer so that I can mark it as correct? `htop` showed me some procs that top was hiding; I think that these were system processes running from the `/usr/sbin` directory. – Tola Odejayi Dec 22 '11 at 20:17
  • There you go sir. Glad it helped ;) – Tim Dec 22 '11 at 20:47

3 Answers3

1

When presented with a similar issue recently I had a look at the rest of the processes. As it happened, none of them were using a lot of the CPU but all of them combined amounted to far more than just the top few.

John Gardeniers
  • 27,458
  • 12
  • 55
  • 109
  • I've seen this myself - a lot of dinky processes using 0.1% - 0.5% can add up pretty quick (and given your load average I wonder how many `httpd` processes you have dong little bursts of CPU activity...) – voretaq7 Dec 22 '11 at 21:27
0

I suggest using the utility htop if it is available in your package manager. Top doesn't always show everything depending on the distro you are using based on my past experiences.

Tim
  • 3,017
  • 17
  • 15
-2

Press H (uppercase) to show threads.