Apache by default is limited to handle not more than 256 requests per second, so you should do a litle optimization by installing a module and a few configuration of that module to make apache enable to handle more than 256 requests per second for high traffic servers. The reason of this default limit is that apache to be able to run on every servers even if they are not powerful and has less ram such a 512MB and not using so much resource that may cause server overload and crash.So if your apache hasn’t configured properly on your powerful server, then by reaching its limit on MaxClients , your apache web server will go down repeatedly that may make you so much surprised.Follow the below solution to optimize your apache web server.At the end please ask your question by leaving a comment and i’ll be so happy to assist you.
also if you have noticed this error in the server log
[error] server reached MaxClients setting, consider raising the MaxClients setting
then this is the right place for you to raise MaxClients and get rid of this error and have your apache optimized to handle more than 256 or 150 default MaxClients limits requests upto even 200
First you must recompile apache with mpm_perfork and if you have cpanel there is an option to add mod_prefork in the easy apache update so add that.This module has been installed and tested on apache running on Centos Linux server.
After recompiling is complete you should now edit this module configuration.You have two choices, whether to create sepprated configuration file and include it in httpd.conf or edit httpd.conf directly that I myself suggest external configuration.I will train both.
if somthing failed due to using the default highperformance.conf then create another file let say highpreformance2.conf ,
open httpd.conf
the location of httpd.conf may be vary to use
run the following command to find where it is
and add this line that contain inclusion of external config file
or if your config name is “highperformance2.conf” it should be
It is completely depend on the name of your external config file name.
or you can also directly edit the httpd.conf instead of creation of external file and include it in httpd.conf
After opening the httpd.conf or seprated configration file edit the prefork directives or if “<IfModule prefork.c>” does not exist add the following completely to it:
After that you edit apache configration “httpd.conf” directly or included seprated configration then you should run the following command to prevent any changes or overwritten that would be occure to the config with cpanel:
You are done now but After all modification to apache configration for the changes take effect you need to restart apache webserver
to do so run the following command
or if you have cpanel installed on your centos server just run the following shell script by just running the command:
as my server is powerfull that have 8gig of ram and have a lot of connection I have used the following settings in it that; it doesn’t mean you should have the same settings that I have
click MaxClients to find it out better
I will tell you each of these apache prefork directive in a better detail later on
Please do not hesitate to ask any questions by commenting here regarding any part that is not clear.
I will be so much grateful to answer your questions .
voshka
No related posts.
Hi, irlogo
if you mean how to find it and enable it in easy apache
there is a module called mpm_prefork
by sellecting it you will have it compiled with apache build
is that what you mean?
Thanks
my server having 12 gb of ram and 12 core cpu with 12 mb catch
what config do i have to put?
Hi
Thats All depends on they way you are going to use your server
ranging from a simple shared hosting with advanced shared hosting with so many websites hosted on it to a server dedicated for a site that has so much traffic and if it has a high load of numbers of downloads
Please let me know what exactly your intention to use of this server has fallen to
THanks
10:13 am
Hello,
who to find mod_prefork in ease apache?