You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Nathan J Kurz <na...@tripod.tripod.com> on 1997/07/09 17:59:49 UTC

Is HARD_SERVER_LIMIT necessary?

I've been wondering why HARD_SERVER_LIMIT needs to be defined at all.
It looks like MaxClients could be used instead in all cases except for
the declaration of the scoreboard struct in scoreboard.h:

short_score servers[HARD_SERVER_LIMIT];

Couldn't the scoreboard be defined like:

typedef struct
    {
    short_score *scoreboard_start;
    global_score global;
    } scoreboard;

and the individual elements in the scoreboard accessed as an offset
from scoreboard_start?

Am I missing something?  Should I write a patch to do this? Because it
would make tuning a lot easier if you didn't have to recompile with a
new HARD_SERVER_LIMIT.

Thanks!

nate@tripod.com
http://www.tripod.com

Re: Is HARD_SERVER_LIMIT necessary?

Posted by Dean Gaudet <dg...@arctic.org>.
On Wed, 9 Jul 1997, Marc Slemko wrote:
> Note that this would also require some changes to the scoreboard file,
> which could be difficult on some OSes with broken mmaps (ie. growing
> mmaped regions) and with gracefull restarts (the structure will change
> without child processes knowing about it). 

graceful restart including a MaxClients increase is what makes this really
difficult.  The children don't actually need the new larger scoreboard... 
but the parent needs to keep the old scoreboard to preserve the
min/maxspare semantics.  In theory you could just have the code allocate a
new scoreboard when required, copy the old child data into the new
scoreboard, and proceed as normal.  The old children won't be playing with
their scoreboard in a way that we care about after a graceful.

> If you look at doing a patch, be sure to do it against 1.3 since some
> things have changed in that area.

Definately.

Dean


Re: Is HARD_SERVER_LIMIT necessary?

Posted by Marc Slemko <ma...@worldgate.com>.
It could and should be gotten rid of iff you can do it in an efficient and
clean way.  Note that in the 1.3 source tree, the scoreboard stuff in
http_main.c, stat_buffer in mod_status.c, and servers in httpd.h are the
only places where anything more than a trivial effort would be required to
get rid of it. 

Note that this would also require some changes to the scoreboard file,
which could be difficult on some OSes with broken mmaps (ie. growing
mmaped regions) and with gracefull restarts (the structure will change
without child processes knowing about it). 

If you look at doing a patch, be sure to do it against 1.3 since some
things have changed in that area.

On Wed, 9 Jul 1997, Nathan J Kurz wrote:

> I've been wondering why HARD_SERVER_LIMIT needs to be defined at all.
> It looks like MaxClients could be used instead in all cases except for
> the declaration of the scoreboard struct in scoreboard.h:
> 
> short_score servers[HARD_SERVER_LIMIT];
> 
> Couldn't the scoreboard be defined like:
> 
> typedef struct
>     {
>     short_score *scoreboard_start;
>     global_score global;
>     } scoreboard;
> 
> and the individual elements in the scoreboard accessed as an offset
> from scoreboard_start?
> 
> Am I missing something?  Should I write a patch to do this? Because it
> would make tuning a lot easier if you didn't have to recompile with a
> new HARD_SERVER_LIMIT.
> 
> Thanks!
> 
> nate@tripod.com
> http://www.tripod.com
>