|
From: | Mike D |
Subject: | Re: [EXTERNAL] Restart apps based on total system CPU usage |
Date: | Thu, 18 Feb 2021 13:06:01 -0700 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |