Blog dedicated to Oracle Applications (E-Business Suite) Technology; covers Apps Architecture, Administration and third party bolt-ons to Apps

Friday, March 7, 2008

Top command CPU column, sum of all rows exceeds 100%

Recently during a performance call, someone asked me why the cpu column in a top command output doesn't total to 100%:

load averages: 16.9, 17.9, 19.3; up 63+02:24:38 18:19:12
2616 processes: 2587 sleeping, 10 zombie, 4 stopped, 15 on cpu
CPU states: 36.6% idle, 42.2% user, 21.2% kernel, 0.0% iowait, 0.0% swap
Memory: 96G phys mem, 29G free mem, 16G swap, 16G free swap

PID USERNAME LWP PRI NICE SIZE RES STATE TIME CPU COMMAND
1686 oraerp01 1 0 4 2820M 1532M cpu 539:23 99.65% oracle
5784 oraerp01 1 38 4 2955M 1473M cpu 674:42 99.64% oracle
20496 oraerp01 1 0 4 4353M 1345M cpu 50.8H 98.98% oracle
28909 oraerp01 1 0 4 5056M 1420M cpu 88.3H 98.29% oracle
27438 oraerp01 1 0 4 1222M 1201M cpu 72:33 97.17% oracle
23596 oraerp02 1 0 0 3242M 2236M cpu 10:29 95.91% oracle
2768 oraerp02 1 0 0 3240M 2231M cpu 52:19 95.72% oracle
22037 oraerp02 1 60 0 3239M 2233M sleep 0:38 57.39% oracle
18232 oraerp02 1 0 0 3239M 2234M cpu 1:29 51.90% oracle
18261 oraerp03 1 0 0 3280M 2271M sleep 1:24 51.62% oracle
23563 oraerp02 1 1 0 3256M 2251M cpu 0:21 36.48% oracle
20855 oraerp02 1 21 0 3245M 2239M cpu 0:21 34.23% oracle
24205 oraerp02 1 10 0 3239M 2234M cpu 0:06 23.47% oracle
23536 oraerp02 1 52 0 3275M 2260M sleep 11:21 16.36% oracle
20283 oraerp02 1 53 0 3238M 2228M sleep 14:58 13.82% oracle

The box from which the above is run is a Sun E2900 with 24 cores and 96 GB RAM. I told that person that, top is actually showing the percentage of a single CPU being used by that process. I have tried to verify from various sources whether my answer was correct and haven't come up with anything conclusive. Will keep looking for the real answer, which may involve going into the source code of top command.

No comments: