You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Arnab Ganguly <ag...@gmail.com> on 2007/03/30 14:59:41 UTC

[users@httpd] Help on MaxClients setting, consider raising the MaxClients setting

Hi All,
Apache version used here is 2.2. I have developed a module which acts a
plugin to the apache.My requirement is that all the request is going to be
handled by single process and multi-threaded.I am using
MPM=worker.Themodule is working
fine.But in the error log I get the following error as  (server reached
=MaxClients setting, consider raising the MaxClients setting)

In the httpd.conf file We have MaxClients = 25 and ThreadsPerChild =
25.Wewon't be able to increase the MaxClients value in this case. As
according to
apache (The maximum number of active child processes is determined by the
MaxClients  directive divided by the  ThreadsPerChild directive).In our case
we want a single active child process to handle the requests received by the
repeater.Also the ThreadsPerChild max value is 25 in Unix.So I am not be
able to modify the params.
Below I have given my MPM config also
<IfModule worker.c>
ServerLimit  2
StartServers 1
MaxClients 25
MinSpareThreads 25
MaxSpareThreads  25
ThreadsPerChild  25
MaxRequestsPerChild 0
</IfModule>

So is there any other way I can increase MaxClients value or I should not
get the error.Any help would be appreciated.Looking forward for response.
Thanks in advance.
-A

Re: [users@httpd] Help on MaxClients setting, consider raising the MaxClients setting

Posted by Arnab Ganguly <ag...@gmail.com>.
Hi,
Thanks for correcting me about the ThreadsPerChild  value.I overlooked 25 as
max value , it is actually the default value.

Also I saw the Apache code file worker.c basically prints the error when the
idle thread count is lesser than the MinSpareThreads.Now if I reduce the
value of MinSpareThreads will my transaction gets slowed?Concept of
MinSpareThreads and MaxClients is little bit confusing to me?

All these for as I am trying to investigate for a time out.At a particular
moment of time I get a  time out ie when  I ping the  websever there is a
time out happening not able to figure it out.

One more thing how do u set the ExtendedStatus in the config file.
A
Thanks in advance
-A

On 3/31/07, Sander Temme <sc...@apache.org> wrote:
>
> Arnab,
>
> On Mar 30, 2007, at 11:21 PM, Arnab Ganguly wrote:
>
> > What I saw was the ServerLimit value = 2 when I kept I saw one root
> > and two daemon process.And among the two daemon it is the only one
> > daemon handles all my request.So my requirement is met.But when I
> > replace the value of ServerLimit = 1 the above behavior is also same.
>
> ServerLimit has no impact on the number of processes actually
> created: it governs the size of some data structures Apache creates
> when it starts up. The actual limiting value is MaxClients and while
> it is true that MaxClients / ThreadsPerChild <= ServerLimit, I
> wouldn't worry about it too much.
>
> > The other config was followed was same as below
> >
> > StartServers 1
> > MaxClients 25
> > MinSpareThreads 25
>
> As Joshua points out this is a confusing value since you don't allow
> the server to spawn more children to satisfy the idle thread
> requirement.  Zero would be a more adequate value but I don't know if
> Apache supports that.
>
> > MaxSpareThreads  25
> > ThreadsPerChild  25
> > MaxRequestsPerChild 0.
> >
> > The minspare threads I will reduce it to 5 or to some lower
> > value.But I still get the error as "MaxClients setting, consider
> > raising the MaxClients setting ".
>
> Apache logs this when it reaches the MaxClients value.  Your setting
> are such that this will always happen (since it'll spawn one child of
> 25 threads on startup).  The line in the error log has no other
> implication: since you are consciously configuring for this situation
> it is completely harmless.
>
> > I can't increase the value of MaxClients ad the number of active
> > child process has to be one also the Threadsperchild has to be 25
> > as this is the max value in Unix.
>
> I don't think this is the case.  Our compile-time default maximum is
> 64, but you can change that using the ThreadLimit directive:
>
> http://httpd.apache.org/docs/2.2/mod/mpm_common.html#threadlimit
>
> > So is there any other way I can subside the error also my
> > requirement is met.I am new to apache and sorry for some basic
> > qustions.
>
> Don't worry about the MaxClients error: it is harmless and attends
> you to a condition that you explicitly create.
>
> S.
>
> --
> sctemme@apache.org            http://www.temme.net/sander/
> Open Source Software Consultant
> PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF
>
> ApacheCon 2007 Europe, May 1-4 in Amsterdam
> http://www.eu.apachecon.com/
>
>
>
>
>

Re: [users@httpd] Help on MaxClients setting, consider raising the MaxClients setting

Posted by Sander Temme <sc...@apache.org>.
Arnab,

On Mar 30, 2007, at 11:21 PM, Arnab Ganguly wrote:

> What I saw was the ServerLimit value = 2 when I kept I saw one root  
> and two daemon process.And among the two daemon it is the only one  
> daemon handles all my request.So my requirement is met.But when I  
> replace the value of ServerLimit = 1 the above behavior is also same.

ServerLimit has no impact on the number of processes actually  
created: it governs the size of some data structures Apache creates  
when it starts up. The actual limiting value is MaxClients and while  
it is true that MaxClients / ThreadsPerChild <= ServerLimit, I  
wouldn't worry about it too much.

> The other config was followed was same as below
>
> StartServers 1
> MaxClients 25
> MinSpareThreads 25

As Joshua points out this is a confusing value since you don't allow  
the server to spawn more children to satisfy the idle thread  
requirement.  Zero would be a more adequate value but I don't know if  
Apache supports that.

> MaxSpareThreads  25
> ThreadsPerChild  25
> MaxRequestsPerChild 0.
>
> The minspare threads I will reduce it to 5 or to some lower  
> value.But I still get the error as "MaxClients setting, consider  
> raising the MaxClients setting ".

Apache logs this when it reaches the MaxClients value.  Your setting  
are such that this will always happen (since it'll spawn one child of  
25 threads on startup).  The line in the error log has no other  
implication: since you are consciously configuring for this situation  
it is completely harmless.

> I can't increase the value of MaxClients ad the number of active  
> child process has to be one also the Threadsperchild has to be 25  
> as this is the max value in Unix.

I don't think this is the case.  Our compile-time default maximum is  
64, but you can change that using the ThreadLimit directive:

http://httpd.apache.org/docs/2.2/mod/mpm_common.html#threadlimit

> So is there any other way I can subside the error also my  
> requirement is met.I am new to apache and sorry for some basic  
> qustions.

Don't worry about the MaxClients error: it is harmless and attends  
you to a condition that you explicitly create.

S.

-- 
sctemme@apache.org            http://www.temme.net/sander/
Open Source Software Consultant
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF

ApacheCon 2007 Europe, May 1-4 in Amsterdam
http://www.eu.apachecon.com/




Re: [users@httpd] Help on MaxClients setting, consider raising the MaxClients setting

Posted by Arnab Ganguly <ag...@gmail.com>.
Hi All,
What I saw was the ServerLimit value = 2 when I kept I saw one root and two
daemon process.And among the two daemon it is the only one daemon handles
all my request.So my requirement is met.But when I replace the value of
ServerLimit = 1 the above behavior is also same.

The other config was followed was same as below

StartServers 1
MaxClients 25
MinSpareThreads 25
MaxSpareThreads  25
ThreadsPerChild  25
MaxRequestsPerChild 0.

The minspare threads I will reduce it to 5 or to some lower value.But I
still get the error as "*MaxClients setting, consider raising the MaxClients
setting* ".I can't increase the value of MaxClients ad the number of active
child process has to be one also the Threadsperchild has to be 25 as this is
the max value in Unix.

So is there any other way I can subside the error also my requirement is
met.I am new to apache and sorry for some basic qustions.
Thanks in advance.
-A

On 3/30/07, Joshua Slive <jo...@slive.ca> wrote:
>
> On 3/30/07, Arnab Ganguly <ag...@gmail.com> wrote:
> > Hi All,
> > Apache version used here is 2.2. I have developed a module which acts a
> > plugin to the apache.My requirement is that all the request is going to
> be
> > handled by single process and multi-threaded.I am using MPM=worker.The
> > module is working fine.But in the error log I get the following error as
> > (server reached =MaxClients setting, consider raising the MaxClients
> > setting)
> >
> > In the httpd.conf file We have MaxClients = 25 and ThreadsPerChild =
> 25.We
> > won't be able to increase the MaxClients value in this case. As
> according to
> > apache (The maximum number of active child processes is determined by
> the
> > MaxClients  directive divided by the  ThreadsPerChild directive).In our
> case
> > we want a single active child process to handle the requests received by
> the
> > repeater.Also the ThreadsPerChild max value is 25 in Unix.So I am not be
> > able to modify the params.
> > Below I have given my MPM config also
> > <IfModule worker.c>
> > ServerLimit  2
> > StartServers 1
> > MaxClients 25
> > MinSpareThreads 25
> > MaxSpareThreads  25
> > ThreadsPerChild  25
> > MaxRequestsPerChild 0
> > </IfModule>
> >
> > So is there any other way I can increase MaxClients value or I should
> not
> > get the error.Any help would be appreciated.Looking forward for
> response.
> > Thanks in advance.
>
> Your config is a little confused.
>
> Why do you have ServerLimit 2 if you only want one process?
>
> You certainly don't want MinSpareThreads 25, since apache is always
> going to want to keep 25 IDLE children, which obviously isn't possible
> under your setup. MinSpareThreads should be set very low.
>
> I also don't understand why you say you can't change ThreadsPerChild.
>
> 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
>
>

Re: [users@httpd] Help on MaxClients setting, consider raising the MaxClients setting

Posted by Joshua Slive <jo...@slive.ca>.
On 3/30/07, Arnab Ganguly <ag...@gmail.com> wrote:
> Hi All,
> Apache version used here is 2.2. I have developed a module which acts a
> plugin to the apache.My requirement is that all the request is going to be
> handled by single process and multi-threaded.I am using MPM=worker.The
> module is working fine.But in the error log I get the following error as
> (server reached =MaxClients setting, consider raising the MaxClients
> setting)
>
> In the httpd.conf file We have MaxClients = 25 and ThreadsPerChild = 25.We
> won't be able to increase the MaxClients value in this case. As according to
> apache (The maximum number of active child processes is determined by the
> MaxClients  directive divided by the  ThreadsPerChild directive).In our case
> we want a single active child process to handle the requests received by the
> repeater.Also the ThreadsPerChild max value is 25 in Unix.So I am not be
> able to modify the params.
> Below I have given my MPM config also
> <IfModule worker.c>
> ServerLimit  2
> StartServers 1
> MaxClients 25
> MinSpareThreads 25
> MaxSpareThreads  25
> ThreadsPerChild  25
> MaxRequestsPerChild 0
> </IfModule>
>
> So is there any other way I can increase MaxClients value or I should not
> get the error.Any help would be appreciated.Looking forward for response.
> Thanks in advance.

Your config is a little confused.

Why do you have ServerLimit 2 if you only want one process?

You certainly don't want MinSpareThreads 25, since apache is always
going to want to keep 25 IDLE children, which obviously isn't possible
under your setup. MinSpareThreads should be set very low.

I also don't understand why you say you can't change ThreadsPerChild.

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