Cant find Apache tuning settings
I was using Nginx for the past few years and now switched to Apache 2.4 due to some compatibility reasons. I'm using Ubuntu 13.10 which ships Apache 2.4.6 by default. I have installed Apache and PHP using
apt-get install apache2
apt-get install php5 php5-mysql libapache2-mod-php5
Site is working without a glitch and super responsive. But Apache spawns many processes and its eating my RAM. Its normal for Apache but my problem is I cant find Apache maxclients and other settings anywhere on Apache2.conf file which is located in /etc/apache2/apache2.conf . Tried putting these inside the file
MinSpareServers X
MaxSpareServers X
ServerLimit X
MaxClients X
MaxRequestsPerChild X
Apache restarts successfully but it doesnt seems like Apache is obeying to these values. I spent a lot of time trying to find the issue but I couldn't. Please help
Thanks
3 Replies
apache2ctl -M | grep -i mpm
If this is prefork, and assuming the configuration is somewhere under /etc/apache2/, the following command should show you where it belongs:
grep -Ri maxclients /etc/apache2/
Keep in mind this may indicate the file you edited (which is apparently not where it belongs) in addition to the correct one.
If you are using the worker or event MPM instead of prefork, your configuration will need to be different.
http://httpd.apache.org/docs/current/upgrading.html
@Vance:
First, verify which Apache multiprocessing module you are actually using with the following:
apache2ctl -M | grep -i mpm
If this is prefork, and assuming the configuration is somewhere under /etc/apache2/, the following command should show you where it belongs:
grep -Ri maxclients /etc/apache2/
Keep in mind this may indicate the file you edited (which is apparently not where it belongs) in addition to the correct one.
If you are using the worker or event MPM instead of prefork, your configuration will need to be different.
Thanks for the information. First command shows its prefork
root@XXXXXX:~# apache2ctl -M | grep -i mpm
mpm_prefork_module (shared)
But the second command does nothing.
root@XXXX:~# grep -Ri maxclients /etc/apache2/
root@XXXX:~#
"nicholasmark" mentioned that Maxclients settings has been changed on Apache 2.4 he is right
I tried
root@XXXX:~# grep -Ri MaxRequestWorkers /etc/apache2/
And it showed me that the configuration file for the prefork is in
/etc/apache2/mods-available/mpm_prefork.conf
I have found the settings on that file. Edited those and I think I'm good to go. Thanks both of you guys