You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Gamesnel - Piethein Strengholt <pi...@gamesnel.nl> on 2005/06/02 08:50:25 UTC

[users@httpd] Apache performance server reached MaxClients setting

I have a plesk (7.5.2 box) running with Redhat 9. This machine (Pentium 
4 1024 mhz) was running fine for quite a long time. This week one of my 
sites became very populair and this gives me some troubles. The apache 
server stops to work and I need to restart it within every 10 minutes. 
Then apache is up and after 10 minutes its down again. The server log 
said this:

[error] server reached MaxClients setting, consider raising the 
MaxClients setting

So I changed the MaxClients from 100 to 256.
This will increase the dying time from 10 minutes till 20 minutes but 
does not solve the problem. When I check the apache status I see this:

//etc/init.d/httpd status
httpd (pid 5073 5072 5071 5070 5069 5068 5067 5065 5064 5063 5062 5061 
5060 5059 5058 5057 5056 5055 5054 5053 5052 5051 5050 5049 5048 5034 
5033 5032 5031 5030 5029 5028 5027 5026 5025 5024 5023 5022 5021 5019 
5018 5010 5009 5008 5007 5006 5004 5003 5002 4998 4997 4995 4994 4991 
4990 4988 4953 4952 4951 4950 4949 4947 4946 4945 4944 4943 4942 4941 
4940 4939 4938 4937 4936 4935 4934 4933 4932 4930 4929 4928 4927 4926 
4925 4924 4923 4922 4921 etc etc etc/

This is my current httpd.conf:

/KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15

<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
MaxClients 256
MaxRequestsPerChild 1000
</IfModule>

<IfModule worker.c>
StartServers 2
MaxClients 256
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>

<IfModule perchild.c>
NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 0
</IfModule>/

Please let me know how I can solve this problem!


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache performance server reached MaxClients setting

Posted by Jirka Vejrazka <ji...@gmail.com>.
One quick-hit solution might be decreasing KeepAlive setting to
something short, say 5 seconds. This will reduce number of processes
"hang" while waiting for the same client reusing keepalive connection.

Also check the documentation for ServerLimit
(http://httpd.apache.org/docs-2.0/mod/mpm_common.html#serverlimit) and
consider increasing this to higher number, along with MaxClients. As
commented above, you'll need a lot of memory (that's what you pay for
popularity ;)

Also check for optimalizations (see Apache performance guide). If you
respond to each request quicker, you can handle more requests at a
given time...

  Jirka

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache performance server reached MaxClients setting

Posted by Joshua Slive <js...@gmail.com>.
On 6/2/05, Gamesnel - Piethein Strengholt <pi...@gamesnel.nl> wrote:
> I have a plesk (7.5.2 box) running with Redhat 9. This machine (Pentium
> 4 1024 mhz) was running fine for quite a long time. This week one of my
> sites became very populair and this gives me some troubles. The apache
> server stops to work and I need to restart it within every 10 minutes.
> Then apache is up and after 10 minutes its down again. The server log
> said this:

What does "stops to work" mean exactly?  Apache should not just stop,
regardless of the load.  It may become very slow.  You can use the
server-status page provided by mod_status plus the "top" display on
your server in combination to figure out what resources are running
out (memory, processor, httpd children, etc).  Depending on what kind
of content you are serving, you may also be running out of other types
of resources like database connections.  That could certainly make
your server appear to freeze.

> [error] server reached MaxClients setting, consider raising the
> MaxClients setting
> 
> So I changed the MaxClients from 100 to 256.
> This will increase the dying time from 10 minutes till 20 minutes but
> does not solve the problem. When I check the apache status I see this:

You should increase MaxClients as far as you can subject to the
condition that you have enough physical memory to hold all the child
processes.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org