Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 May 2002 16:15:05 -0700 (PDT)
From:      Patrick Thomas <root@utility.clubscholarship.com>
To:        <freebsd-questions@freebsd.org>
Subject:   confusing CPU stats in `top`
Message-ID:  <20020502160811.P29785-100000@utility.clubscholarship.com>

next in thread | raw e-mail | index | archive | help

background:  normally, when I run `top` in a multu processor system, the
CPU percentage summary tells me the percentage being used of the entire 4
processor range.

So, if for instance the system is lightly loaded (99.9% idle) and suddenly
some process takes up a ton of cycles, I will see this in `top`:

92731     88     2   0 42280K 18464K poll   1 238:30 99.95% 99.95% mysqld

BUT - in the summary at the top of `top`, I will see roughly 74.9% idle -
since only one of the four CPUs is being eaten up.  THis makes sense, and
it what I have learned to look for in 4-proc systems.

----

So what is happening here ?


last pid: 24283;  load averages:  1.71,  2.07,  2.62
up 97+17:51:18  16:09:59
964 processes: 4 running, 956 sleeping, 4 zombie
CPU states: 11.1% user,  0.2% nice, 19.0% system,  0.0% interrupt, 69.7%
idle
Mem: 1289M Active, 234M Inact, 376M Wired, 82M Cache, 199M Buf, 28M Free
Swap: 2018M Total, 6316K Used, 2012M Free

  PID USERNAME PRI NICE  SIZE    RES STATE  C   TIME   WCPU    CPU COMMAND
92645     88     2   0 42280K 18464K poll   1 238:30 38.82% 38.82% mysqld
56036 root       2   0  1836K  1316K select 1  21:58  6.84%  6.84% master
 8398     88     2   0 39272K 20700K poll   0 996:14  5.47%  5.47% mysqld
23617 root      31   0  2968K  2108K CPU1   2   0:01  5.31%  2.54% top
19435   1006     2  20 48916K 39828K poll   0  35:20  1.12%  1.12% httpd
93802    500     2   0 64804K 61024K sbwait 1   2:40  0.63%  0.63% httpd
87873 root       2   0  1596K  1180K select 2   0:01  0.20%  0.20% proftpd
93750    500     2   0 70352K 66716K accept 1   3:24  0.15%  0.15% httpd
93751    500     2   0 66396K 62412K accept 0   3:02  0.15%  0.15% httpd
 4965    500     2   0 49084K 45436K sbwait 2   0:02  0.10%  0.10% httpd
53925 user      38   5 10652K  4960K CPU2   0   7:40  0.05%  0.05% ack
  747 root       2   0   872K   284K poll   2 159:24  0.00%  0.00% httpd
68955 root       2   0   872K   368K poll   1 148:05  0.00%  0.00% httpd
96533     72     2   0 13360K 12624K poll   0  29:00  0.00%  0.00% ircd



As you can see, the server reports 69.7% idle

BUT, that would imply processes using up a total of (30.3 x 4) `top`
reported percent ... which is not the case - if you add up the percentages
in the `top` reported processes, they add up to ~58 or so, and if we
divide that by four we would expect to see 85% idle or so, instead of
69.7% idle.

So why is this exhibiting this behavior, when as I said, if you have a
non-loaded system, and a single process goes to 99%, the overall load is
roughly 74%  ??

thanks,

PT


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020502160811.P29785-100000>