Configuring apache for server monitoring

We adjusted some of the apache config parameters to try and keep it from using up all the memory on the server today.

We turned on apache monitoring through mod_monitor which makes the URL:

http://domain.com/server-status

Show some good stats on number of servers and what they are doing.

The command

watch ps -ylC httpd –sort:rss

Shows the httpd processes and their memory usage.

We learned that we are using pre-fork module of apache (vs. worker based ) which is what is distributed with REDHAT.
It uses one process for each request ( not multi-threaded)

The config we adjusted was the MaxRequestsPerChild – our php queries tend to make the httpd processes GROW over time so we set the max to make them shut down and start a fresh one after 10 requests – hopefully this will keep the system from running out of memory.

## OUR REDHAT APACHE IS COMPILED WITH PREFORK MODULE NOT WORKER

StartServers 8
MinSpareServers 5
MaxSpareServers 10
ServerLimit 150
MaxClients 150
MaxRequestsPerChild 10

The configs we did to turn on the monitoring are:

ExtendedStatus On

SetHandler server-status
Order deny,allow
Deny from all
Allow from XX.XX.XX.XX

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published.