monit-general
[Top][All Lists]
Advanced

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

Re: [EXTERNAL] Restart apps based on total system CPU usage


From: Mike D
Subject: Re: [EXTERNAL] Restart apps based on total system CPU usage
Date: Thu, 18 Feb 2021 13:06:01 -0700

Hey Lutz,

The issue I have with checking the app itself is that it forks into many different children to perform the work so no single app is using all the CPU. What I want to check for is if the total system usage is BELOW a certain threshold, restart the parent app.

Thanks,
Mike

On Thu, Feb 18, 2021 at 12:58 PM Lutz Mader <lutz.mader@freenet.de> wrote:
Hello Mike,
if the application is known you should look to the samples too.

>> But you can check a specific application also, see
>> https://mmonit.com/monit/documentation/monit.html#CONFIGURATION-EXAMPLES

Based on the following sample (from Configuration Samples)

> check process apache with pidfile /var/run/httpd.pid
>       start program = "/etc/init.d/httpd start"
>       stop program  = "/etc/init.d/httpd stop"
>       if cpu > 40% for 2 cycles then alert
>       if total cpu > 60% for 2 cycles then alert
>       if total cpu > 80% for 5 cycles then restart
>       if mem > 100 MB for 5 cycles then stop

you can define resource limits for each service.

With regards,
Lutz


reply via email to

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