Monitoring CPU activity - Linux

This is a discussion on Monitoring CPU activity - Linux ; Hi - I'd like to monitor the activity of the CPUs on a Linux machine. Is there a utility that does this? ... I know of mstat, but I'm looking for a utility that reports CPU activity dynamically -- like ...

+ Reply to Thread
Results 1 to 19 of 19

Thread: Monitoring CPU activity

  1. Monitoring CPU activity

    Hi -

    I'd like to monitor the activity of the CPUs on a Linux machine. Is
    there a utility that does this? ... I know of mstat, but I'm looking
    for a utility that reports CPU activity dynamically -- like top.

    Thanks

    - Olumide


  2. Re: Monitoring CPU activity

    In comp.unix.shell Olumide <50295@web.de>:
    > Hi -


    > I'd like to monitor the activity of the CPUs on a Linux machine. Is
    > there a utility that does this? ... I know of mstat, but I'm looking
    > for a utility that reports CPU activity dynamically -- like top.


    What's wrong with 'top'?

    --
    Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
    mail: echo zvpunry@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
    #bofh excuse 69: knot in cables caused data stream to become
    twisted and kinked

  3. Re: Monitoring CPU activity

    "Olumide" <50295@web.de> writes:

    > I'd like to monitor the activity of the CPUs on a Linux machine.


    gkrellm

    --
    Maurizio Loreti ROT13:ybergv@cq.vasa.vg | (@_
    Un. of Padova, Dept. of Physics, Padova, Italy | //\
    http://www.pd.infn.it/~loreti/mlo.html | V_/_

  4. Re: Monitoring CPU activity

    On Mon, 11 Dec 2006 07:32:15 -0800, Olumide wrote:

    > Hi -
    >
    > I'd like to monitor the activity of the CPUs on a Linux machine. Is
    > there a utility that does this? ... I know of mstat, but I'm looking
    > for a utility that reports CPU activity dynamically -- like top.
    >
    > Thanks
    >
    > - Olumide


    If you are looking for a graphical display then use gnome-system-monitor,
    if you want the output in a terminal then the thing most like top is top.

  5. Re: Monitoring CPU activity


    Olumide wrote:
    > Hi -
    >
    > I'd like to monitor the activity of the CPUs on a Linux machine. Is
    > there a utility that does this? ... I know of mstat, but I'm looking
    > for a utility that reports CPU activity dynamically -- like top.


    It would help if you said what it is you need that "top" doesn't give
    you.

    Perhaps "sar"? See http://aplawrence.com/Words/2004_01_11.html

    --
    Tony Lawrence
    Unix/Linux/Mac OS X Resources
    http://aplawrence.com


  6. Re: Monitoring CPU activity

    > I'd like to monitor the activity of the CPUs on a Linux machine.

    I'm interested in monitoring multiple CPUs


  7. Re: Monitoring CPU activity

    [ Followup-To -> comp.os.linux.hardware, well it doesn't match
    that great but all other do even less... ]

    In comp.unix.shell Olumide <50295@web.de>:
    >> I'd like to monitor the activity of the CPUs on a Linux machine.


    > I'm interested in monitoring multiple CPUs


    Then finally start reading the fine manual 'man top' how to
    switch on separate numbers for each CPU, trust me it is magic.

    Good luck

    --
    Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
    mail: echo zvpunry@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
    #bofh excuse 391: We already sent around a notice about that.

  8. Re: Monitoring CPU activity

    Michael Heiming writes:

    > In comp.unix.shell Olumide <50295@web.de>:
    >> Hi -

    >
    >> I'd like to monitor the activity of the CPUs on a Linux machine. Is
    >> there a utility that does this? ... I know of mstat, but I'm looking
    >> for a utility that reports CPU activity dynamically -- like top.

    >
    > What's wrong with 'top'?


    On (at least) Linux top(1) and i'd venture a guess every other utility
    that uses `/proc/stat' or `/proc/uptime' is not very accurate, or goes
    against my intuition of what constitutes load and measures that.

    For instance: http://www.boblycat.org/~malc/apc/lo...-lbreakout.png
    (substitute x86 for ppc to witness even more deviation on PowerPC)

    The calculations of load based on timing the idle handler (and/or using
    the niced background process and measuring it's forward progress) is in
    stark contrast with what `/proc' tells.

    (On the screenshot(s) red represents results obtained from `/proc' and
    yellow is derived from measured time spent in idle handler)

    The situation with load on Windows is similar, i have been so far
    unable to find a method to measure the load the matches my, perhaps,
    naive understanding of it. There is:
    http://cpu.rightmark.org/products/rmclock.shtml
    but there are no sources to see what it does, nor an explanation of
    the algorithm(s) it uses.

    --
    vale

  9. Re: Monitoring CPU activity

    Olumide wrote:
    >> I'd like to monitor the activity of the CPUs on a Linux machine.

    >
    > I'm interested in monitoring multiple CPUs
    >


    nmon for Linux is quite nice.

    http://www-128.ibm.com/developerwork...u-analyze_aix/

    -James

  10. Re: Monitoring CPU activity


    Olumide wrote:

    > I'd like to monitor the activity of the CPUs on a Linux machine. Is
    > there a utility that does this? ... I know of mstat, but I'm looking
    > for a utility that reports CPU activity dynamically -- like top.
    >
    > Thanks


    No offense, but this is the worst question I've seen on USENET in
    months.

    DS


  11. Re: Monitoring CPU activity

    "Olumide" <50295@web.de> writes:

    > Hi -
    >
    > I'd like to monitor the activity of the CPUs on a Linux machine. Is
    > there a utility that does this? ... I know of mstat, but I'm looking
    > for a utility that reports CPU activity dynamically -- like top.


    I like gkrellm - for a small footprint graph-type utility.


    --
    Sending unsolicited commercial e-mail to this account incurs a fee of
    $500 per message, and acknowledges the legality of this contract.

  12. Re: Monitoring CPU activity

    In comp.unix.shell malc :
    > Michael Heiming writes:


    >> In comp.unix.shell Olumide <50295@web.de>:
    >>> Hi -


    >>> I'd like to monitor the activity of the CPUs on a Linux machine. Is
    >>> there a utility that does this? ... I know of mstat, but I'm looking
    >>> for a utility that reports CPU activity dynamically -- like top.


    >> What's wrong with 'top'?


    > On (at least) Linux top(1) and i'd venture a guess every other utility
    > that uses `/proc/stat' or `/proc/uptime' is not very accurate, or goes
    > against my intuition of what constitutes load and measures that.


    > For instance: http://www.boblycat.org/~malc/apc/lo...-lbreakout.png
    > (substitute x86 for ppc to witness even more deviation on PowerPC)


    Works fine for me, perhaps you want to update procps to something
    more recent, quite a few distro come with aged versions which
    might not work that great on recent kernel.

    --
    Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
    mail: echo zvpunry@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
    #bofh excuse 99: SIMM crosstalk.

  13. Re: Monitoring CPU activity

    Michael Heiming writes:

    > In comp.unix.shell malc :
    >> Michael Heiming writes:

    >
    >>> In comp.unix.shell Olumide <50295@web.de>:
    >>>> Hi -

    >
    >>>> I'd like to monitor the activity of the CPUs on a Linux machine. Is
    >>>> there a utility that does this? ... I know of mstat, but I'm looking
    >>>> for a utility that reports CPU activity dynamically -- like top.

    >
    >>> What's wrong with 'top'?

    >
    >> On (at least) Linux top(1) and i'd venture a guess every other utility
    >> that uses `/proc/stat' or `/proc/uptime' is not very accurate, or goes
    >> against my intuition of what constitutes load and measures that.

    >
    >> For instance: http://www.boblycat.org/~malc/apc/lo...-lbreakout.png
    >> (substitute x86 for ppc to witness even more deviation on PowerPC)

    >
    > Works fine for me, perhaps you want to update procps to something
    > more recent, quite a few distro come with aged versions which
    > might not work that great on recent kernel.


    My point is: it's the values in `/proc' which are in my view are false
    not the utilities that present some graphs, cpu load percentages.
    [and fwiw PPC version used for making the second screenshot uses 2.6.18.3
    kernel and very recent procps]

    The reason why it may work fine for you is it you are measuring
    processes wich load the system in a sampleble (and prefferable by the
    kernel) pattern.

    You can try it yourself get LBreakout 010315 start a new game and
    don't do anything, `top' `vmstat' will (most likely) tell you that
    your system is ~1-3% loaded, while reniced background task will make a
    lot less progress than it should have been if that was true, and
    actually timing the idle handler will tell similar story - machine is
    MUCH more loaded.

    --
    vale

  14. Re: Monitoring CPU activity

    "Olumide" <50295@web.de> wrote:
    >
    >> I'd like to monitor the activity of the CPUs on a Linux machine.

    >
    >I'm interested in monitoring multiple CPUs


    One thing to remember is that there is no way to get an instantaneous
    snapshot of CPU use. At any given point in time, a CPU is either 100% in
    use or 100% idle. The only way to measure CPU use is to integrate over
    time, which is what "top" reports.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.

  15. Re: Monitoring CPU activity

    malc wrote:

    > The calculations of load based on timing the idle handler (and/or using
    > the niced background process and measuring it's forward progress) is in
    > stark contrast with what `/proc' tells.


    Maybe it is because for energy efficiency reasons, there is no mor
    "background process". If a CPU is idle, it should stop.

    You can't use a stopped CPU to measure anything.

    --
    Josef M÷llers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett


  16. Re: Monitoring CPU activity

    On 2006-12-12, Josef Moellers wrote:
    > malc wrote:
    >
    >> The calculations of load based on timing the idle handler (and/or using
    >> the niced background process and measuring it's forward progress) is in
    >> stark contrast with what `/proc' tells.

    >
    > Maybe it is because for energy efficiency reasons, there is no mor
    > "background process". If a CPU is idle, it should stop.


    How could you tell?

    > You can't use a stopped CPU to measure anything.


    If you're measuring something, it isn't stopped, it's doing your
    measuring.

    --
    Chris F.A. Johnson, author
    Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
    ===== My code in this post, if any, assumes the POSIX locale
    ===== and is released under the GNU General Public Licence

  17. Re: Monitoring CPU activity

    Chris F.A. Johnson wrote:
    > On 2006-12-12, Josef Moellers wrote:
    >
    >>malc wrote:
    >>
    >>
    >>>The calculations of load based on timing the idle handler (and/or using
    >>>the niced background process and measuring it's forward progress) is in
    >>>stark contrast with what `/proc' tells.

    >>
    >>Maybe it is because for energy efficiency reasons, there is no mor
    >>"background process". If a CPU is idle, it should stop.

    >
    >
    > How could you tell?


    By looking into the data sheets. By reading what is published. A stopped
    CPU consumes less power than a running CPU.

    >>You can't use a stopped CPU to measure anything.

    >
    >
    > If you're measuring something, it isn't stopped, it's doing your
    > measuring.


    Exactly.

    --
    Josef M÷llers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett


  18. Re: Monitoring CPU activity

    "Olumide" <50295@web.de> writes:

    >> I'd like to monitor the activity of the CPUs on a Linux machine.

    >
    > I'm interested in monitoring multiple CPUs


    I want to monitor my monitor...


    Best regards
    Martin J°rgensen

    --
    ---------------------------------------------------------------------------
    Home of Martin J°rgensen - http://www.martinjoergensen.dk

  19. Re: Monitoring CPU activity

    Josef Moellers writes:

    > malc wrote:
    >
    >> The calculations of load based on timing the idle handler (and/or using
    >> the niced background process and measuring it's forward progress) is in
    >> stark contrast with what `/proc' tells.

    >
    > Maybe it is because for energy efficiency reasons, there is no mor
    > "background process". If a CPU is idle, it should stop.


    Linux calls default_idle/pm_idle[1] as part of it's normal idle chain,
    default_idle/pm_idle might execute `hlt' or use something else to
    reduce power consumption, in either case time spent doing this is
    properly caclulated.

    >
    > You can't use a stopped CPU to measure anything.


    I beg to differ:

    start_time = gettimeofday ();
    call reduce_power_consumption ();
    end_time = gettimeofday ();
    cummulative_idle_time += end_time - start_time;

    is valid regardless of the way `reduce_power_consumption' works. And
    this, in essence, is what i do.

    And once again, the load reported by this is consistent with
    measurements via background nice process that just burns cycles,
    i.e. the machine (should) _never_ enters low power modes.

    [1] On X86, things on other systems are a tad bit different.

    --
    vale

+ Reply to Thread