Top not showing cpu usage even remotely accurately
Tamouh H.
hakmi at rogers.com
Thu Aug 10 04:45:58 UTC 2006
> But since running 5.x (5.5-STABLE since 1st Aug) top can show
> 0.0% idle but the cpu usages shown don't add up to much of a
> fraction of 100%.
>
> For a typical illustration: 'make index' has been running for
> hours, and here's a shot of 'nice top', o)rdered by cpu,
> showing S)ystem procs:
>
> last pid: 62397; load averages: 2.06, 2.09, 2.13 up
> 3+03:57:39 13:11:27
> 154 processes: 6 running, 125 sleeping, 23 waiting CPU
> states: 77.3% user, 0.0% nice, 22.7% system, 0.0%
> interrupt, 0.0% idle
> Mem: 79M Active, 24M Inact, 37M Wired, 5640K Cache, 25M Buf,
> 3388K Free
> Swap: 384M Total, 133M Used, 251M Free, 34% Inuse
>
> PID USERNAME PRI NICE SIZE RES STATE TIME WCPU
> CPU COMMAND
> 62380 root 122 0 788K 648K RUN 0:01 19.48% 1.86% make
> 736 smithi 97 0 27000K 3184K select 89:56 1.07%
> 1.07% kdeinit
> 762 smithi 96 0 29708K 7428K select 14:01 0.93%
> 0.93% kdeinit
> 699 smithi 96 0 52320K 10288K select 105:02 0.88% 0.88% Xorg
> 62394 root 125 0 580K 440K RUN 0:00 7.00% 0.34% make
> 754 smithi 96 0 30972K 6308K select 57:22 0.15%
> 0.15% kdeinit
> 770 smithi 8 0 2524K 660K nanslp 20:51 0.05%
> 0.05% ascpu
> 'ps auxww' cpu percentages reveal little more, except that
> make index is running 'make -j2 ..' hence the ~2.0 load average.
>
> Ignore the high swap use; most of it is numerous quiescent
> kwrite, httpd and mozilla sessions pushed out to swap on this
> lil' 160MB laptop; 'systat -vm' shows it's not actually doing
> any paging during this time.
>
> Any ideas why top hasn't much of a clue about what's consuming cpu?
>
> Cheers, Ian
I've the same issue with FBSD 5.4 and TOP. In fact, the load averages are so irrelevant now that I barely pay attention to them. The server goes to 4 or 6 load averages without slowing down, and other times the load average would be 0.8 and the server is running slow.
An example of unmatching TOP:
last pid: 17889; load averages: 0.60, 0.52, 0.50 up 3+17:22:33 00:41:45
186 processes: 2 running, 183 sleeping, 1 lock
CPU states: 30.0% user, 0.0% nice, 1.7% system, 0.1% interrupt, 68.3% idle
Mem: 1678M Active, 1110M Inact, 287M Wired, 87M Cache, 112M Buf, 103M Free
Swap: 8762M Total, 1584K Used, 8760M Free
PID USERNAME PRI NICE SIZE RES STATE C TIME WCPU CPU COMMAND
5071 nobody 101 0 43124K 35180K CPU2 2 0:07 14.89% 14.89% httpd
14409 nobody 4 0 43940K 36076K sbwait 0 0:01 1.22% 1.22% httpd
95515 nobody 4 0 39892K 32188K sbwait 1 0:08 0.29% 0.29% httpd
17656 prpcon 4 0 9916K 5680K sbwait 1 0:01 0.26% 0.24% cppop
18006 root 8 0 3032K 2324K nanslp 0 25:35 0.05% 0.05% perl
783 root 96 0 9704K 4572K select 3 17:39 0.05% 0.05% cppop
3820 mysql 20 0 339M 251M kserel 3 43:34 0.00% 0.00% mysqld
744 root 8 20 16776K 15120K nanslp 0 40:53 0.00% 0.00% perl
72899 root 20 0 21704K 20128K kserel 3 30:25 0.00% 0.00% clamd
913 root 97 0 11616K 4864K select 3 5:27 0.00% 0.00% cpsrvd
1065 mailnull 96 0 5880K 2828K select 0 3:22 0.00% 0.00% exim-4.62-0
More information about the freebsd-questions
mailing list