Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Nov 28, 2013 11:31 am 
Offline
Senior Member

Joined: Sat Sep 25, 2010 2:25 am
Posts: 75
Website: http://www.ruchirablog.com
Location: Sri Lanka
Hi Guys,
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

Code:
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

<IfModule prefork.c>
StartServers X
MinSpareServers X
MaxSpareServers X
ServerLimit X
MaxClients X
MaxRequestsPerChild X
</IfModule>

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


Top
   
PostPosted: Fri Nov 29, 2013 6:37 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
First, verify which Apache multiprocessing module you are actually using with the following:
Code:
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:
Code:
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.


Top
   
PostPosted: Fri Nov 29, 2013 6:55 am 
Offline
Junior Member

Joined: Fri Nov 01, 2013 8:16 am
Posts: 21
Website: http://purbeckpixels.com
Location: England
Also, bear in mind that 'MaxClients' has been renamed to 'MaxRequestWorkers', and 'MaxRequestsPerChild' has been renamed to 'MaxConnectionsPerChild' in 2.4 (the Apache documentation says the old names are still supported, but some configurations may require the new names):

http://httpd.apache.org/docs/current/upgrading.html (see 'Other configuration changes')


Top
   
PostPosted: Fri Nov 29, 2013 8:04 am 
Offline
Senior Member

Joined: Sat Sep 25, 2010 2:25 am
Posts: 75
Website: http://www.ruchirablog.com
Location: Sri Lanka
Vance wrote:
First, verify which Apache multiprocessing module you are actually using with the following:
Code:
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:
Code:
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

Code:
root@XXXXXX:~# apache2ctl -M | grep -i mpm
 mpm_prefork_module (shared)



But the second command does nothing.

Code:
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

Code:
root@XXXX:~# grep -Ri MaxRequestWorkers /etc/apache2/


And it showed me that the configuration file for the prefork is in

Code:
/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

_________________
www.ruchirablog.com


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group