You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Vikrama Sanjeeva <vi...@gmail.com> on 2010/01/25 14:56:37 UTC

[users@httpd] Help me in setting up MaxClients

Hello All,

This is regarding production servers. Recently Apache server hit MaxClient
settings; resulting in crash of sites. However, sites was back to normal
after restarting Apache.

I read about MaxClient settings and increase it from 200 to 250 (as I read
somewhere that 256 is a limit). Since then sites are working fine. But still
I see average concurrent request on Apache is 180-200 which sometime goes to
220 as well. This is threatening, as we are planning to put more sites live
on same Apache.

Therefore, I am considering to increase MaxClient in order to handle
"at-least" 600 concurrent request.

I will be grateful if somebody can assist me in setting the right values for
ServerLimit, MaxClient, MinSpareServers and MaxSpareServers. Also, what
maximum values I can have for MaxClients (*want to know max concurrent users
Apache can handle.*)


*Machine Specs are*:

*Manufacturer:* Sun
*Model:* T5240
*Operating System: *Solaris 10 10/08 s10s_u6wos_07b SPARC
*CPU(s):* 2x UltraSPARC-T2+ @1415 MHz; 128 Cores 128 Threads
*Memory:* 32544 MB


*Apache Version*:
*Server version:* Apache/2.2.11 (Unix)
*Server built:*   Jan  5 2009 22:19:26

*Existing MaxClient Settings*:

<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
MaxClients       250
MaxRequestsPerChild  0
</IfModule>

Note: I am not good in Solaris/*.nix commands :(

Bye,
Viki.

Re: [users@httpd] Help me in setting up MaxClients

Posted by Jeff Trawick <tr...@gmail.com>.
On Mon, Jan 25, 2010 at 6:13 PM, Vikrama Sanjeeva
<vi...@gmail.com> wrote:
> Hi Jeff,
>
>     Below is statistics from vmstat while everything is running including
> httpd:
>
>>> vmstat 2 3
>  kthr      memory            page            disk          faults      cpu
>  r b w   swap  free  re  mf pi po fr de sr rm s0 s1 s3   in   sy   cs us sy
> id
>  0 0 0 32953272 20946824 11 22 0 3 3  0  0 -0  0  1 -0  872 1041  601  0  0
> 100
>  0 0 0 23225344 11281392 51 104 0 0 0 0  0  0  0  3  0 1024 1767  684  0  0
> 100
>  0 0 0 23224768 11280792 1 4 0  0  0  0  0  0  0  0  0  892 1080  473  0  0
> 100
>
> So with this, I have:
> Free Swap: 22  GB
> Free RAM: 10 GB
>
> Here I am doing a defensive supposition by assuming 5/10 GB of Free RAM
> "could be" occupied by future applications (if any). So, I am left with 5 GB
> of Free Memory. Same for Free Swap, assuming I am left with 5 GB Free Swap
>
> Putting values in MaxClient Formula:
>
> MaxClient = (RAM Size - some room for other processes) / Avg
> HTTPD Process Size
>
> MaxClient = (32768 - 27648) / 12 = 426 (approx)
>
>   Does it mean, I can set MaxClient value to 426 ? If yes, then:

yes, 426 is very safe as far as RAM goes

(as I mentioned before, 12MB is in excess of the per-process RAM
requirements, so I expect you could go much higher; unfortunately I
don't have clear instructions on how to use pmap or other tools to
find the real per-process RAM requirements)

also confirm that 12M * 426 is less than the available swap space

>
> (i) I have to make sure ServerLimit is also = 426  [As per your presentation
> for MPM prefork] ?

y

> (ii) Make sure backend server node (tomcat AJP port) can accept 426
> concurrent requests ?

the big picture for that part of the presentation is to consider the
relationship between number of connections hitting Apache and number
of clients hitting the backend (e.g., Tomcat)

if every connection that hits Apache gets forwarded to Tomcat, you
should align the capacity of Apache and Tomcat fairly closely

if only some connections that hit Apache get forwarded to Tomcat,
you'd expect that the capacity of Apache should be much larger than
that of Tomcat

---------------------------------------------------------------------
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] Help me in setting up MaxClients

Posted by Eric Covener <co...@gmail.com>.
On Sun, Jan 31, 2010 at 2:00 AM, Vikrama Sanjeeva
<vi...@gmail.com> wrote:
> Hi Eric,
>
>   I don't know why you didn't got the my previous post on which I asked for
> help. Anyways, here it is again: I need help in making calculation based on
> memory statistics which I provided.
>

Jeff has already described how this calculation exaggerates the
physical RAM requirements by assuming that none of the memory is
shared across processes.  As a sanity check, predict your ram and swap
usage for doubling MaxClients then check your results experimentally.

I sure hope you weren't waiting around for answers to these:

> (i) I have to make sure ServerLimit is also = 426  [As per your
> presentation for MPM prefork] ?

ServerLimit has to be greater than or equal to your new MaxClients, as
per the manual and the initial response to this thread.

> (ii) Make sure backend server node (tomcat AJP port) can accept 426
> concurrent requests ?
>

Discussion of the number of web container connections/threads for
Tomcat is off-topic here.  Surely a million results are waiting on
google.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
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] Help me in setting up MaxClients

Posted by Vikrama Sanjeeva <vi...@gmail.com>.
Hi Eric,

  I don't know why you didn't got the my previous post on which I asked for
help. Anyways, here it is again: I need help in making calculation based on
memory statistics which I provided.


On 1/26/10, Vikrama Sanjeeva <vi...@gmail.com> wrote:
> Hi Jeff,
>
>     Below is statistics from vmstat while everything is running including
> httpd:
>
>>> vmstat 2 3
>  kthr      memory            page            disk          faults      cpu
>  r b w   swap  free  re  mf pi po fr de sr rm s0 s1 s3   in   sy   cs us
sy
> id
>  0 0 0 32953272 20946824 11 22 0 3 3  0  0 -0  0  1 -0  872 1041  601  0
 0
> 100
>  0 0 0 23225344 11281392 51 104 0 0 0 0  0  0  0  3  0 1024 1767  684  0
 0
> 100
>  0 0 0 23224768 11280792 1 4 0  0  0  0  0  0  0  0  0  892 1080  473  0
 0
> 100
>
> So with this, I have:
> Free Swap: 22  GB
> Free RAM: 10 GB
>
> Here I am doing a defensive supposition by assuming 5/10 GB of Free RAM
> "could be" occupied by future applications (if any). So, I am left with 5
> GB
> of Free Memory. Same for Free Swap, assuming I am left with 5 GB Free Swap
>
> Putting values in MaxClient Formula:
>
> MaxClient = (RAM Size - some room for other processes) / Avg
> HTTPD Process Size
>
> MaxClient = (32768 - 27648) / 12 = 426 (approx)
>
>   Does it mean, I can set MaxClient value to 426 ? If yes, then:
>
> (i) I have to make sure ServerLimit is also = 426  [As per your
> presentation
> for MPM prefork] ?
> (ii) Make sure backend server node (tomcat AJP port) can accept 426
> concurrent requests ?
>
> Bye,
> Viki.

Bye,
Viki.

On Sat, Jan 30, 2010 at 3:38 AM, Eric Covener <co...@gmail.com> wrote:

> On Fri, Jan 29, 2010 at 6:42 PM, Vikrama Sanjeeva
> <vi...@gmail.com> wrote:
> > Hi,
> >
> >  Can somebody help me with this ?
>
> With what? You posted at the top of a giant thread with no context.
>
> --
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> 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] Help me in setting up MaxClients

Posted by Eric Covener <co...@gmail.com>.
On Fri, Jan 29, 2010 at 6:42 PM, Vikrama Sanjeeva
<vi...@gmail.com> wrote:
> Hi,
>
>  Can somebody help me with this ?

With what? You posted at the top of a giant thread with no context.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
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] Help me in setting up MaxClients

Posted by Vikrama Sanjeeva <vi...@gmail.com>.
Hi,

  Can somebody help me with this ?

Thanks

Bye,
Viki.

On 1/26/10, Vikrama Sanjeeva <vi...@gmail.com> wrote:
> Hi Jeff,
>
>     Below is statistics from vmstat while everything is running including
> httpd:
>
>>> vmstat 2 3
>  kthr      memory            page            disk          faults      cpu
>  r b w   swap  free  re  mf pi po fr de sr rm s0 s1 s3   in   sy   cs us sy
> id
>  0 0 0 32953272 20946824 11 22 0 3 3  0  0 -0  0  1 -0  872 1041  601  0  0
> 100
>  0 0 0 23225344 11281392 51 104 0 0 0 0  0  0  0  3  0 1024 1767  684  0  0
> 100
>  0 0 0 23224768 11280792 1 4 0  0  0  0  0  0  0  0  0  892 1080  473  0  0
> 100
>
> So with this, I have:
> Free Swap: 22  GB
> Free RAM: 10 GB
>
> Here I am doing a defensive supposition by assuming 5/10 GB of Free RAM
> "could be" occupied by future applications (if any). So, I am left with 5
> GB
> of Free Memory. Same for Free Swap, assuming I am left with 5 GB Free Swap
>
> Putting values in MaxClient Formula:
>
> MaxClient = (RAM Size - some room for other processes) / Avg
> HTTPD Process Size
>
> MaxClient = (32768 - 27648) / 12 = 426 (approx)
>
>   Does it mean, I can set MaxClient value to 426 ? If yes, then:
>
> (i) I have to make sure ServerLimit is also = 426  [As per your
> presentation
> for MPM prefork] ?
> (ii) Make sure backend server node (tomcat AJP port) can accept 426
> concurrent requests ?
>
> Bye,
> Viki.
>
>
>
>
>
>
> On Mon, Jan 25, 2010 at 10:54 PM, Jeff Trawick <tr...@gmail.com> wrote:
>
>> On Mon, Jan 25, 2010 at 1:26 PM, Vikrama Sanjeeva
>> <vi...@gmail.com> wrote:
>> > Hi All,
>> >
>> >    Thanks Jeff for the presentation. Its informative.
>> >
>> > Actually, I am trying to calculate what MaxClient I can set. I know my
>> > server is strong and as Danny and you said, setting 600 will not be a
>> risk.
>> > I however, will prefer to do some calculation to drive this value.
>> > Since
>> I
>> > am not Solaris command expert, therefore I am having difficulty in
>> > doing
>> > calculation.
>> >
>> > My objective is to follow below formula to calculate MaxClient as
>> mentioned
>> > on Apache site:
>> > http://httpd.apache.org/docs/2.2/misc/perf-tuning.html
>> >
>> > "This procedure for doing this is simple: determine the size of your
>> average
>> > Apache process, by looking at your process list via a tool such as top,
>> and
>> > divide this into your total available memory, leaving some room for
>> > other
>> > processes."
>> >
>> > As I understand, it says:      (RAM Size / Avg HTTPD Process Size) -
>> > some
>> > room for other proceeses
>>
>> slight fix to your formula:
>>
>> Max httpd processes = (RAM Size - some room for other processes) / Avg
>> HTTPD Process Size
>>
>> ---------------------------------------------------------------------
>> 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
>>
>>
>

---------------------------------------------------------------------
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] Help me in setting up MaxClients

Posted by Vikrama Sanjeeva <vi...@gmail.com>.
Hi Jeff,

    Below is statistics from vmstat while everything is running including
httpd:

>> vmstat 2 3
 kthr      memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr rm s0 s1 s3   in   sy   cs us sy
id
 0 0 0 32953272 20946824 11 22 0 3 3  0  0 -0  0  1 -0  872 1041  601  0  0
100
 0 0 0 23225344 11281392 51 104 0 0 0 0  0  0  0  3  0 1024 1767  684  0  0
100
 0 0 0 23224768 11280792 1 4 0  0  0  0  0  0  0  0  0  892 1080  473  0  0
100

So with this, I have:
Free Swap: 22  GB
Free RAM: 10 GB

Here I am doing a defensive supposition by assuming 5/10 GB of Free RAM
"could be" occupied by future applications (if any). So, I am left with 5 GB
of Free Memory. Same for Free Swap, assuming I am left with 5 GB Free Swap

Putting values in MaxClient Formula:

MaxClient = (RAM Size - some room for other processes) / Avg
HTTPD Process Size

MaxClient = (32768 - 27648) / 12 = 426 (approx)

  Does it mean, I can set MaxClient value to 426 ? If yes, then:

(i) I have to make sure ServerLimit is also = 426  [As per your presentation
for MPM prefork] ?
(ii) Make sure backend server node (tomcat AJP port) can accept 426
concurrent requests ?

Bye,
Viki.






On Mon, Jan 25, 2010 at 10:54 PM, Jeff Trawick <tr...@gmail.com> wrote:

> On Mon, Jan 25, 2010 at 1:26 PM, Vikrama Sanjeeva
> <vi...@gmail.com> wrote:
> > Hi All,
> >
> >    Thanks Jeff for the presentation. Its informative.
> >
> > Actually, I am trying to calculate what MaxClient I can set. I know my
> > server is strong and as Danny and you said, setting 600 will not be a
> risk.
> > I however, will prefer to do some calculation to drive this value. Since
> I
> > am not Solaris command expert, therefore I am having difficulty in doing
> > calculation.
> >
> > My objective is to follow below formula to calculate MaxClient as
> mentioned
> > on Apache site:
> > http://httpd.apache.org/docs/2.2/misc/perf-tuning.html
> >
> > "This procedure for doing this is simple: determine the size of your
> average
> > Apache process, by looking at your process list via a tool such as top,
> and
> > divide this into your total available memory, leaving some room for other
> > processes."
> >
> > As I understand, it says:      (RAM Size / Avg HTTPD Process Size) - some
> > room for other proceeses
>
> slight fix to your formula:
>
> Max httpd processes = (RAM Size - some room for other processes) / Avg
> HTTPD Process Size
>
> ---------------------------------------------------------------------
> 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] Help me in setting up MaxClients

Posted by Jeff Trawick <tr...@gmail.com>.
On Mon, Jan 25, 2010 at 1:26 PM, Vikrama Sanjeeva
<vi...@gmail.com> wrote:
> Hi All,
>
>    Thanks Jeff for the presentation. Its informative.
>
> Actually, I am trying to calculate what MaxClient I can set. I know my
> server is strong and as Danny and you said, setting 600 will not be a risk.
> I however, will prefer to do some calculation to drive this value. Since I
> am not Solaris command expert, therefore I am having difficulty in doing
> calculation.
>
> My objective is to follow below formula to calculate MaxClient as mentioned
> on Apache site:
> http://httpd.apache.org/docs/2.2/misc/perf-tuning.html
>
> "This procedure for doing this is simple: determine the size of your average
> Apache process, by looking at your process list via a tool such as top, and
> divide this into your total available memory, leaving some room for other
> processes."
>
> As I understand, it says:      (RAM Size / Avg HTTPD Process Size) - some
> room for other proceeses

slight fix to your formula:

Max httpd processes = (RAM Size - some room for other processes) / Avg
HTTPD Process Size

---------------------------------------------------------------------
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] Help me in setting up MaxClients

Posted by Jeff Trawick <tr...@gmail.com>.
On Mon, Jan 25, 2010 at 1:26 PM, Vikrama Sanjeeva
<vi...@gmail.com> wrote:
> Hi All,
>
>    Thanks Jeff for the presentation. Its informative.
>
> Actually, I am trying to calculate what MaxClient I can set. I know my
> server is strong and as Danny and you said, setting 600 will not be a risk.
> I however, will prefer to do some calculation to drive this value. Since I
> am not Solaris command expert, therefore I am having difficulty in doing
> calculation.
>
> My objective is to follow below formula to calculate MaxClient as mentioned
> on Apache site:
> http://httpd.apache.org/docs/2.2/misc/perf-tuning.html
>
> "This procedure for doing this is simple: determine the size of your average
> Apache process, by looking at your process list via a tool such as top, and
> divide this into your total available memory, leaving some room for other
> processes."
>
> As I understand, it says:      (RAM Size / Avg HTTPD Process Size) - some
> room for other proceeses
>
> Out of these 3 variables, I am able to conclude:
> RAM Size = 32544 MB
> Avg httpd process size: 12 MB

Hmmm, 12 MB is a typical prefork child process size at least on x86
*including* the httpd executable code; there's only one copy of that
executable code living in RAM across the processes.  I don't know a
handy command to get the size of process-unique data (stack, heap,
etc.).  It probably requires looking at pmap output?  I guess you
could use 12MB as an extremely conservative (i.e., worst case) number.

Also remember the need for a separate swap space sanity check on Solaris:

potential httpd swap use is entire httpd child process size *
MaxClients (if using prefork MPM); make sure you have enough swap
space
make sure you have enough swap space


> But how to calculcate "size for other processes" ? One thing I want to
> highlight here is that; we are running application server (JBOSS) on same
> machine with almost 10 JVM nodes. Average Java process size for these are
> 3-4 GB. No other applications are running on this machine. And yes, we are
> using "mod_jk" for backend server loadbalancing.

Here are some hints on calculating free memory and free swap space:

http://forums.sun.com/thread.jspa?threadID=5100488

If you find free memory and free swap space with all the normal
services but httpd running, then set aside perhaps 30% for growth of
those processes or other things you didn't measure, then you find out
how much memory and swap is potentially available for httpd.

(BTW, you'd want to duplicate this sort of sanity check every so often
-- make sure there is free memory and swap space while everything is
running, including httpd.)

---------------------------------------------------------------------
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] Help me in setting up MaxClients

Posted by Vikrama Sanjeeva <vi...@gmail.com>.
Hi All,

   Thanks Jeff for the presentation. Its informative.

Actually, I am trying to calculate what MaxClient I can set. I know my
server is strong and as Danny and you said, setting 600 will not be a risk.
I however, will prefer to do some calculation to drive this value. Since I
am not Solaris command expert, therefore I am having difficulty in doing
calculation.

My objective is to follow below formula to calculate MaxClient as mentioned
on Apache site:
http://httpd.apache.org/docs/2.2/misc/perf-tuning.html

"*This procedure for doing this is simple: determine the size of your
average Apache process, by looking at your process list via a tool such as
top, and divide this into your total available memory, leaving some room for
other processes.*"

As I understand, it says:      (RAM Size / Avg HTTPD Process Size) - some
room for other proceeses

Out of these 3 variables, I am able to conclude:
RAM Size = 32544 MB
Avg httpd process size: 12 MB

But how to calculcate "size for other processes" ? One thing I want to
highlight here is that; we are running application server (JBOSS) on same
machine with almost 10 JVM nodes. Average Java process size for these are
3-4 GB. No other applications are running on this machine. And yes, we are
using "mod_jk" for backend server loadbalancing.

Bye,
Viki.


On Mon, Jan 25, 2010 at 5:44 PM, Jeff Trawick <tr...@gmail.com> wrote:

> On Mon, Jan 25, 2010 at 8:56 AM, Vikrama Sanjeeva
> <vi...@gmail.com> wrote:
> > Hello All,
> >
> > This is regarding production servers. Recently Apache server hit
> MaxClient
> > settings; resulting in crash of sites. However, sites was back to normal
> > after restarting Apache.
>
> The expected symptom is that Apache is unresponsive to additional
> requests until some of the child processes finish what they're working
> on.
>
> Restarting Apache without increasing MaxClients isn't helpful; if it
> is a hard restart it trashes the current connections.
>
> > I read about MaxClient settings and increase it from 200 to 250 (as I
> read
> > somewhere that 256 is a limit).
>
> Run apachectl -V to see the limit; it should be in the tens of thousands.
>
> >                                     Since then sites are working fine.
> But still
> > I see average concurrent request on Apache is 180-200 which sometime goes
> to
> > 220 as well. This is threatening, as we are planning to put more sites
> live
> > on same Apache.
> >
> > Therefore, I am considering to increase MaxClient in order to handle
> > "at-least" 600 concurrent request.
> >
> > I will be grateful if somebody can assist me in setting the right values
> for
> > ServerLimit, MaxClient, MinSpareServers and MaxSpareServers.
>
> (I'm trying to get a public URL for the slides I sent you privately
> which offer some advice here.)
>
> >                                                              Also, what
> > maximum values I can have for MaxClients (want to know max concurrent
> users
> > Apache can handle.)
>
> That's workload-specific.  Here are some interesting notes from
> someone playing with a similar box a few years ago:
>
> http://www.stdlib.net/~colmmacc/2006/03/23/niagara-vs-ftpheanetie-showdown/<http://www.stdlib.net/%7Ecolmmacc/2006/03/23/niagara-vs-ftpheanetie-showdown/>
>
> ---------------------------------------------------------------------
> 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] Help me in setting up MaxClients

Posted by Mark Watts <m....@eris.qinetiq.com>.
On Mon, 2010-01-25 at 11:47 -0500, Jeff Trawick wrote:
> my bad; it doesn't, as you point out

Out of interest, is it possible/feasible to get httpd to dump its
running config? Could be quite useful...

> for httpd 2.2.x:
> 
> prefork's hard limit is 200000 child processes; worker's limits are
> 20000 child processes and 20000 threads per process
> 
> (expect to hit system limits long before that)

We usually hit bandwidth limits first :)

Mark.

-- 
Mark Watts BSc RHCE MBCS
Senior Systems Engineer, Managed Services Manpower
www.QinetiQ.com
QinetiQ - Delivering customer-focused solutions
GPG Key: http://www.linux-corner.info/mwatts.gpg

Re: [users@httpd] Help me in setting up MaxClients

Posted by Jeff Trawick <tr...@gmail.com>.
On Mon, Jan 25, 2010 at 11:36 AM, Mark Watts <m....@eris.qinetiq.com> wrote:
> On Mon, 2010-01-25 at 09:44 -0500, Jeff Trawick wrote:
>> On Mon, Jan 25, 2010 at 8:56 AM, Vikrama Sanjeeva
>> <vi...@gmail.com> wrote:
>> > Hello All,
>> >
>> > This is regarding production servers. Recently Apache server hit MaxClient
>> > settings; resulting in crash of sites. However, sites was back to normal
>> > after restarting Apache.
>>
>> The expected symptom is that Apache is unresponsive to additional
>> requests until some of the child processes finish what they're working
>> on.
>>
>> Restarting Apache without increasing MaxClients isn't helpful; if it
>> is a hard restart it trashes the current connections.
>>
>> > I read about MaxClient settings and increase it from 200 to 250 (as I read
>> > somewhere that 256 is a limit).
>>
>> Run apachectl -V to see the limit; it should be in the tens of thousands.
>
> Umm, does it?
>
>
> # apachectl -V

my bad; it doesn't, as you point out

for httpd 2.2.x:

prefork's hard limit is 200000 child processes; worker's limits are
20000 child processes and 20000 threads per process

(expect to hit system limits long before that)

---------------------------------------------------------------------
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] Help me in setting up MaxClients

Posted by Mark Watts <m....@eris.qinetiq.com>.
On Mon, 2010-01-25 at 09:44 -0500, Jeff Trawick wrote:
> On Mon, Jan 25, 2010 at 8:56 AM, Vikrama Sanjeeva
> <vi...@gmail.com> wrote:
> > Hello All,
> >
> > This is regarding production servers. Recently Apache server hit MaxClient
> > settings; resulting in crash of sites. However, sites was back to normal
> > after restarting Apache.
> 
> The expected symptom is that Apache is unresponsive to additional
> requests until some of the child processes finish what they're working
> on.
> 
> Restarting Apache without increasing MaxClients isn't helpful; if it
> is a hard restart it trashes the current connections.
> 
> > I read about MaxClient settings and increase it from 200 to 250 (as I read
> > somewhere that 256 is a limit).
> 
> Run apachectl -V to see the limit; it should be in the tens of thousands.

Umm, does it?


# apachectl -V
Server version: Apache/2.2.13 (Unix)
Server built:   Sep 17 2009 15:37:59
Server's Module Magic Number: 20051115:23
Server loaded:  APR 1.3.3, APR-Util 1.3.4
Compiled using: APR 1.3.3, APR-Util 1.2.7
Architecture:   32-bit
Server MPM:     Worker
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/worker"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

# apachectl -V
Server version: Apache/2.2.14 (Unix)
Server built:   Dec  3 2009 10:25:53
Server's Module Magic Number: 20051115:23
Server loaded:  APR 1.3.9, APR-Util 1.3.9
Compiled using: APR 1.3.9, APR-Util 1.3.9
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"


-- 
Mark Watts BSc RHCE MBCS
Senior Systems Engineer, Managed Services Manpower
www.QinetiQ.com
QinetiQ - Delivering customer-focused solutions
GPG Key: http://www.linux-corner.info/mwatts.gpg

Re: [users@httpd] Help me in setting up MaxClients

Posted by Jeff Trawick <tr...@gmail.com>.
On Mon, Jan 25, 2010 at 8:56 AM, Vikrama Sanjeeva
<vi...@gmail.com> wrote:
> Hello All,
>
> This is regarding production servers. Recently Apache server hit MaxClient
> settings; resulting in crash of sites. However, sites was back to normal
> after restarting Apache.

The expected symptom is that Apache is unresponsive to additional
requests until some of the child processes finish what they're working
on.

Restarting Apache without increasing MaxClients isn't helpful; if it
is a hard restart it trashes the current connections.

> I read about MaxClient settings and increase it from 200 to 250 (as I read
> somewhere that 256 is a limit).

Run apachectl -V to see the limit; it should be in the tens of thousands.

>                                     Since then sites are working fine. But still
> I see average concurrent request on Apache is 180-200 which sometime goes to
> 220 as well. This is threatening, as we are planning to put more sites live
> on same Apache.
>
> Therefore, I am considering to increase MaxClient in order to handle
> "at-least" 600 concurrent request.
>
> I will be grateful if somebody can assist me in setting the right values for
> ServerLimit, MaxClient, MinSpareServers and MaxSpareServers.

(I'm trying to get a public URL for the slides I sent you privately
which offer some advice here.)

>                                                              Also, what
> maximum values I can have for MaxClients (want to know max concurrent users
> Apache can handle.)

That's workload-specific.  Here are some interesting notes from
someone playing with a similar box a few years ago:

http://www.stdlib.net/~colmmacc/2006/03/23/niagara-vs-ftpheanetie-showdown/

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