Skip to content

Instantly share code, notes, and snippets.

@eksiscloud
Last active April 22, 2020 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eksiscloud/930bd74b5df8d4e566d380294e956dd5 to your computer and use it in GitHub Desktop.
Save eksiscloud/930bd74b5df8d4e566d380294e956dd5 to your computer and use it in GitHub Desktop.
Monit: Apache2 (backend of Varnish)
#Apache2
check process apache with pidfile /var/run/apache2/apache2.pid
group www
start program = "/usr/sbin/service apache2 start"
stop program = "/usr/sbin/service apache2 stop"
if cpu is greater than 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if totalmem > 2 GB for 5 cycles then restart
if children > 250 then restart
if 3 restarts within 5 cycles then timeout
@eksiscloud
Copy link
Author

eksiscloud commented Apr 22, 2020

This follows only cpu and totalmem. Webserver itself is monitored by sites. If Apache2 falls, every site will fall too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment