Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

How reliable is top?

  • 14-11-2007 10:48am
    #1
    Closed Accounts Posts: 669 ✭✭✭


    CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
               total   12.0%    0.0%    6.4%   0.0%     0.8%    0.0%  779.2%
               cpu00    0.4%    0.0%    0.0%   0.0%     0.0%    0.0%   99.5%
               cpu01    3.9%    0.0%    0.9%   0.0%     0.4%    0.0%   94.6%
               cpu02    0.0%    0.0%    0.0%   0.0%     0.0%    0.0%  100.0%
               cpu03    0.0%    0.0%    0.0%   0.0%     0.0%    0.0%  100.0%
               cpu04    0.9%    0.0%    0.4%   0.0%     0.0%    0.0%   98.5%
               cpu05    0.4%    0.0%    0.0%   0.0%     0.0%    0.0%   99.5%
               cpu06    4.4%    0.0%    4.9%   0.0%     0.0%    0.0%   90.6%
               cpu07    1.9%    0.0%    0.4%   0.0%     0.4%    0.0%   97.0%
    

    Notice the 779.2% total idle. I have a sister box - which is an exact replica of this machine and it's as idle as this one, yet it's total is 98.5% idle.

    :confused:


Comments

  • Registered Users, Registered Users 2 Posts: 1,606 ✭✭✭djmarkus


    i prefer htop


  • Closed Accounts Posts: 669 ✭✭✭pid()


    A very imformative post djmarkus. :p

    Why?


  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    What OS is this on?

    For linux, you can get details from /proc relatively easily. Top uses libgtop iirc, and is considered pretty solid. There is a solaris port of it, but of course, solaris collects resource usage information differently to linux.

    htop almost certainly uses the same library, but it provides more information.


  • Closed Accounts Posts: 669 ✭✭✭pid()


    Khannie wrote: »
    What OS is this on?

    For linux, you can get details from /proc relatively easily. Top uses libgtop iirc, and is considered pretty solid. There is a solaris port of it, but of course, solaris collects resource usage information differently to linux.

    htop almost certainly uses the same library, but it provides more information.

    Thanks Khannie. It's Redhat Enterprise Server, running 2.4.21-50.ELsmp.


  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    I'm guessing that's RHEL3. I think that's the last one that used a 2.4 kernel. That 779 looks like a refresh issue to me. Pure speculation, but I'd say it's 79.2% idle or thereabouts.


  • Advertisement
  • Closed Accounts Posts: 669 ✭✭✭pid()


    Yep, RHEL3. I'm convinced it's not a refresh issue. Notice what it says for total user % here:
               total  112.8%    0.0%   56.8%   0.0%    24.0%    0.0%  604.0%
               cpu00    7.3%    0.0%    5.3%   0.0%     0.0%    0.0%   87.2%
               cpu01   19.7%    0.0%    5.4%   0.0%     5.4%    0.0%   69.4%
               cpu02    9.8%    0.0%    6.8%   0.0%     2.9%    0.0%   80.3%
               cpu03    6.3%    0.0%    5.8%   0.0%     1.4%    0.0%   86.2%
               cpu04   22.5%    0.0%    8.8%   0.0%     2.9%    0.0%   65.6%
               cpu05   22.0%    0.0%   13.7%   0.0%     4.9%    0.0%   59.3%
               cpu06   14.2%    0.0%    8.3%   0.0%     1.4%    0.0%   75.9%
               cpu07   11.2%    0.0%    2.9%   0.4%     4.9%    0.0%   80.3%
    

    It's at 112.8%. It was at 300% a while ago. Hehe, I'm stumped.

    EDIT: Also note this from the Redhat people:
    Redhat wrote:
    An average percent of CPU time. This field examines all aspects of CPU time, including user, idle, and niced tasks. Because niced tasks are included, the total can go over 100%, so do not be alarmed if this is the case (unless it is an outrageous value, such as 160%).

    Looks like it's some sort of issue.


  • Registered Users, Registered Users 2 Posts: 535 ✭✭✭Dorsanty


    No one else think 'total' = 'sum of the values' for the different CPUs? A total is numerically different to an average. So it's not lying to you.


    So if you are 100% idle on all CPUs and have 8 CPUs you are 800% idle, i.e. you seriously need to consider why you've payed for an 8 CPU system that's not doing anything. :)


  • Closed Accounts Posts: 669 ✭✭✭pid()


    Dorsanty wrote: »
    No one else think 'total' = 'sum of the values' for the different CPUs? A total is numerically different to an average. So it's not lying to you.


    So if you are 100% idle on all CPUs and have 8 CPUs you are 800% idle, i.e. you seriously need to consider why you've payed for an 8 CPU system that's not doing anything. :)

    And the winner is.... Dorsanty! :)


  • Registered Users, Registered Users 2 Posts: 590 ✭✭✭bman


    pid() wrote: »
    And the winner is.... Dorsanty! :)

    I'm not so sure. Here's the output of top on a machine we have at work with 4 CPUs:
    CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
               total    5.3%    0.0%    1.6%   0.0%     0.9%   21.5%   70.4%
               cpu00    5.3%    0.0%    0.7%   0.0%     3.1%   24.5%   66.1%
               cpu01    8.9%    0.0%    1.9%   0.0%     0.1%   23.3%   65.5%
               cpu02    4.7%    0.0%    1.9%   0.0%     0.1%    0.0%   93.0%            
               cpu03    2.3%    0.0%    1.9%   0.0%     0.1%   38.2%   57.2%
    

    total here is the average of all 4 CPUs.


  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    Hmmmm, which version of top is that lads? I'm running "procps version 3.2.7" at home (gentoo) and I only see 1 CPU state for my quad core. It says
    Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
    

    edit: Found it. You press 1 to toggle. Me like.


  • Advertisement
  • Closed Accounts Posts: 669 ✭✭✭pid()


    bman wrote: »
    I'm not so sure. Here's the output of top on a machine we have at work with 4 CPUs:
    CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
               total    5.3%    0.0%    1.6%   0.0%     0.9%   21.5%   70.4%
               cpu00    5.3%    0.0%    0.7%   0.0%     3.1%   24.5%   66.1%
               cpu01    8.9%    0.0%    1.9%   0.0%     0.1%   23.3%   65.5%
               cpu02    4.7%    0.0%    1.9%   0.0%     0.1%    0.0%   93.0%            
               cpu03    2.3%    0.0%    1.9%   0.0%     0.1%   38.2%   57.2%
    

    total here is the average of all 4 CPUs.

    Yeah, I dunno... Here's the output from the two sister machines, which are identical:

    Machine 1:
               CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
               total    3.2%    0.0%    1.6%   0.0%     0.0%    0.0%  793.6%
               cpu00    0.4%    0.0%    0.0%   0.0%     0.0%    0.0%   99.5%
               cpu01    0.9%    0.0%    0.0%   0.0%     0.0%    0.0%   99.0%
               cpu02    0.0%    0.0%    0.0%   0.0%     0.0%    0.0%  100.0%
               cpu03    0.0%    0.0%    0.9%   0.0%     0.0%    0.0%   99.0%
               cpu04    0.4%    0.0%    0.4%   0.0%     0.0%    0.0%   99.0%
               cpu05    0.0%    0.0%    0.0%   0.0%     0.0%    0.0%  100.0%
               cpu06    0.4%    0.0%    0.0%   0.0%     0.0%    0.0%   99.5%
               cpu07    1.4%    0.0%    0.4%   0.0%     0.4%    0.0%   97.5%
    

    Machine 2:
               CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
               total    0.1%    0.0%    0.1%   0.0%     0.1%    0.0%   99.3%
               cpu00    0.5%    0.0%    0.3%   0.0%     0.0%    0.0%   99.0%
               cpu01    0.3%    0.0%    0.7%   0.0%     0.5%    0.0%   98.2%
               cpu02    0.1%    0.0%    0.0%   0.0%     0.0%    0.0%   99.8%
               cpu03    0.0%    0.0%    0.0%   0.0%     0.0%    0.0%  100.0%
               cpu04    0.0%    0.0%    0.0%   0.0%     0.0%    0.0%  100.0%
               cpu05    0.0%    0.0%    0.0%   0.0%     0.0%    0.0%  100.0%
               cpu06    0.3%    0.0%    0.0%   0.0%     0.0%    0.0%   99.6%
               cpu07    0.0%    0.0%    0.0%   0.5%     0.9%    0.0%   98.4%
    

    But essentially, if you add up the idle percentages on machine 1, you get the total percentage at the top. Perhaps someone has just changed the way top is viewing this on machine 1.


  • Registered Users, Registered Users 2 Posts: 590 ✭✭✭bman


    I suppose unless you use top for some important reason you'll manage with it totalling all the CPUs percentages. Probably something in your configuration rather than a bug.


Advertisement