monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [monit] Quad Core Monitoring


From: Martin Pala
Subject: Re: [monit] Quad Core Monitoring
Date: Fri, 02 May 2008 23:10:19 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20080313 Iceape/1.1.9 (Debian-1.1.9-2)

As mentioned ... monit watches the CPU resources of the whole system (sum of all cores/CPUs), it's not possible to monitor particular core/CPU.

Monitoring single core doesn't make sense i think, since on timesharing system without mentioned resource management can any process run on any CPU. Scheduler can switch the process/thread to any core. If your mysql has multiple threads (almost certainly has), it's not running on one core unless you use resource management to dedicate part of the HW.

Why do you need to watch single core on SMP system? It's like watching single DIMM usage ... your mysql process can be migrated to any core, if you'll define the CPU usage as 25%, it corresponds to eating CPU resources corresponding to one core on 4-core system.


Martin



address@hidden wrote:
Can you tell me what the syntax is for monitoring a particular cpu core?

Currently I have something like the following example:

if cpu usage (user) > 70% then alert

How do I specify a particular core? Using "if cpu0 usage (user) > 70% then alert" gave me "/etc/monitrc:111: Error: syntax error 'cpu0'"

Thanks,


On Fri, May 2, 2008 at 1:43 PM, Martin Pala <address@hidden <mailto:address@hidden>> wrote:

    Monit can monitor "unlimited" number of CPUs ... each core is
    counted as one CPU (regardless in which socket it sits). CPU usage
    of multicore and singlecore machines whether single CPU or SMP can
    be monitored using existing monit capabilities.

    Regarding mysql ... it can have several threads and each of these
    threads can be scheduled on different core/CPU and run in parallel.
    You never know on which core it runs unless you use resource
    management - for example Solaris allows you to bind the specific
    applications to specific resource pools which can define CPU
    boundary. Without the resource management, the process can be
    switched by the scheduler freely (including thread migrations).



    Martin



    address@hidden <mailto:address@hidden> wrote:

        Thanks, but I don't think that would work.  If all four
        processors were above 25%, it would give a false positive.  Am I
        correct in thinking that monit doesn't actually have the
        capability to monitor more than one cpu?  Maybe this should be a
        wishlist item?


        On Tue, Apr 29, 2008 at 12:34 PM, Martin Pala
        <address@hidden <mailto:address@hidden>
        <mailto:address@hidden <mailto:address@hidden>>>
        wrote:

           Monit is reporting the CPU usage as total (corresponding to first
           example of top).

           If the application will get 100% of one core on 4-core
        system, it's
           CPU usage should be reported by monit is 25% (since 4 * 25% =
        100%).

           You can thus use rule like this:

            if cpu usage > 25% then restart

           Martin




           address@hidden <mailto:address@hidden>
        <mailto:address@hidden <mailto:address@hidden>>
        wrote:

               We have an issue were mysqld hogs up 100% of one of our cpu
               cores from time to time.  How can I configure monit to
        restart
               mysqld when this happens.
               For an example of what I am talking about, top normally shows
               only one cpu but if you press '1' it will show all the cpus.
               (normal top)
               top - 18:13:11 up 10 days, 21:59,  1 user,  load average:
        1.56,
               1.81, 2.08
               Tasks: 186 total,   5 running, 181 sleeping,   0 stopped,
          0 zombie
               Cpu(s): 31.6% us,  7.6% sy,  0.0% ni, 60.8% id,  0.0% wa,
         0.0%
               hi,  0.0% si

               (top after pressing '1')
               top - 18:13:54 up 10 days, 22:00,  1 user,  load average:
        1.73,
               1.81, 2.07
               Tasks: 185 total,   3 running, 182 sleeping,   0 stopped,
          0 zombie
               Cpu0  : 29.4% us,  5.9% sy,  0.0% ni, 63.9% id,  0.7% wa,
         0.0%
               hi,  0.0% si
               Cpu1  : 27.9% us,  5.6% sy,  0.0% ni, 65.5% id,  1.0% wa,
         0.0%
               hi,  0.0% si
               Cpu2  : 23.1% us,  5.7% sy,  0.0% ni, 70.6% id,  0.7% wa,
         0.0%
               hi,  0.0% si
               Cpu3  : 25.3% us,  6.2% sy,  0.0% ni, 67.5% id,  1.0% wa,
         0.0%
               hi,  0.0% si

               (sample when mysqld is hogging cpu time)
               top - 18:13:54 up 10 days, 22:00,  1 user,  load average:
        1.73,
               1.81, 2.07
               Tasks: 185 total,   3 running, 182 sleeping,   0 stopped,
          0 zombie
               Cpu0  : 100 % us,  5.9% sy,  0.0% ni, 63.9% id,  0.7% wa,
         0.0%
               hi,  0.0% si
               Cpu1  : 7.9% us,  5.6% sy,  0.0% ni, 65.5% id,  1.0% wa,
         0.0%
               hi,  0.0% si
               Cpu2  : 3.1% us,  5.7% sy,  0.0% ni, 70.6% id,  0.7% wa,
         0.0%
               hi,  0.0% si
               Cpu3  : 5.3% us,  6.2% sy,  0.0% ni, 67.5% id,  1.0% wa,
         0.0%
               hi,  0.0% si

               So, how do I get monit to restart mysqld when just one cpu is
               pegged at 100%?  It's not always Cpu0, it could be any of
        them.

               Thanks,


------------------------------------------------------------------------

               --
               To unsubscribe:
               http://lists.nongnu.org/mailman/listinfo/monit-general



           --
           To unsubscribe:
           http://lists.nongnu.org/mailman/listinfo/monit-general



        ------------------------------------------------------------------------


        --
        To unsubscribe:
        http://lists.nongnu.org/mailman/listinfo/monit-general



    --
    To unsubscribe:
    http://lists.nongnu.org/mailman/listinfo/monit-general



------------------------------------------------------------------------

--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

[Prev in Thread] Current Thread [Next in Thread]