httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: getting rid of 'server reached MaxClients setting' error
Date Wed, 28 Apr 2004 18:20:39 GMT
Geoffrey Young wrote:
> 
> Stas Bekman wrote:
> 
>>I think this misleading error is really a bug in Apache:
>>
>>[Mon Apr 26 15:28:44 2004] [error] server reached MaxClients setting,
>>consider raising the MaxClients setting
> 
> 
>>It sounds like a one-off bug to me.
> 
> 
> the only issue I see is that now both 1.0 and 2.0 environments two servers
> by default instead of one, which seems noteworthy I guess.  I can't see the
> harm, but when I changed from httpd -X to StartServers 1 I did so with
> trepidation.  at the very least I think we should support a way to get back
> to a single server if users desire it.  -minclients=0 (so maxclients =
> minclients + 1 = 1) not only isn't intuitive, but it doesn't look to be
> supported in the code.  maybe a -singleserver option is worth adding, which
> would effectively restore everything you propose to undo here?

That's a different issue, this patch just changes more than one thing. I don't 
think that setting maxclients = minclients + 1, makes it any different from 
before. It's the SpareMin/Max and StartServers that may need to be tweaking to 
preserve the previous state.

I've reviewed again the config change, and the only difference from before are 
the prefork and apache1.3 settings, and they are the same, so before we had:

  <IfModule prefork.c>
      StartServers         1
      MaxClients           @MaxClients@
      MaxRequestsPerChild  0
  </IfModule>

There was one server starting and more added when needed up to MaxClients. So 
if you wanted to have only one client, you'd say: -maxclients 1

The new change is exactly the same:

<IfModule prefork.c>
     StartServers         @MinClients@
     MinSpareServers      @MinClients@
     MaxSpareServers      @MinClients@
     MaxClients           @MaxClients@
     MaxRequestsPerChild  0
  </IfModule>

if you say -minclients 1, then you will ever have 1 server, as min/max are set 
to 1 too. Unless your testing setup requires 2 servers, in which case two 
servers will start because MaxClient == 2. But this is OK, since you won't be 
able to run that test with 1 server (e.g. proxy test), as it'll just hang. 
Keeping min/maxSpare == startservers, prevents from Apache to spawn more than 
StartServers servers.

Any flows in my logic?

> maybe just calling t_server_log_is_expected() early on is a better idea (if
> it's even possible)?

You mean to workaround the Apache bug? I don't think it'll work. You may end 
up covering real errors as 'ok', since that Apache error message is not under 
your control.

Actually this change has a positive side effect, if before setting to 
-maxclients=1, you'd have tests requiring 2 servers (e.g. proxy) will make 
your whole suit hang, now it'll work just fine.

finally 'maxclients = minclients + 1 ' is only a default, you have a complete 
flexibility to set maxclients explicitly, so if you really want to, nothing 
stops you from saying -maxclients=1 -minclients=1.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message