I am surprised to learn that the default value for MaxClients on a Debian 
install is as low as 20.

The value of MaxClients depends on a number of factors including the number of 
requests per second and the time required to serve each request. The longer it 
takes to serve a request, the longer a slot will be occupied and unavailable 
for serving other requests.

The number of requests per second depends on the number of simultaneous users, 
characteristics of the web sites (number of graphical elements per page), user 
patterns... 

It also depends on the protocol used (HTTP/1.0 or 1.1), whether KeepAlive is 
used and the configuration of the browser (number of simultaneous connections 
to the same web site in HTTP/1.0).

You basically just need to adapt the value of MaxClients to the needs of your 
site and the performance of your hardware and OS. With the prefork MPM one 
process is forked for each incoming connection and there is a need to limit the 
number of httpd processes on the system in order not to fill the process table 
and memory, and context-switching is expensive so performance becomes an issue. 
Using the worker MPM you can have one process handle just about as many 
connections as you wish (in my case 100) so processes and memory is a lesser 
preoccupation. Recent processors are also very good at doing multi-threading.

If Apache does little work for each request but spends a lot of time waiting 
for a back-end to reply, then you can set MaxClients to a very high value. If 
the requests are processor-intensive you may need to reduce MaxClients and 
align several servers to handle the total volume of requests with reasonable 
performance.

Then there may be considerations like the need to throttle the traffic to 
back-end application servers when the Apache server is used as a reverse proxy 
that will make you set a lower limit than you would otherwise.

If you are suspecting a DoS attack you should start by looking for unusual 
activity in your server logs. I however find it very unlikely that it is the 
case. If you were under attack, raising the value to 100 would not have done 
the trick.

-ascs

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 08, 2006 7:11 AM
To: users@httpd.apache.org
Subject: [EMAIL PROTECTED] Why the sudden need to raise MaxClients?

We are using Apache 2.0.54 on Debian GNU/Linux (standard Debian packages). The 
server had been running for several months with absolutely no problems. A 
couple of days ago, Apache started slowing down, then would eventually stop 
responding completely. The only way to fix it was to restart Apache. It got to 
the point that Apache would only stay functional for a few seconds at a time. 
Watching the Apache logs revealed no unusual activity before the lockup.

I discovered the MaxClients setting, which in Debian defaults to 20 for the 
prefork MPM. I raised it to 100, and the problem went away. I believe the 
default for this value is normally 256.

What would cause this problem all of the sudden? My first thought was a DOS 
attack. Am I on the right track?

--df


---------------------------------------------------------------------
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: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
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: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to