httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject Re: 1.2 log rotation II
Date Sun, 21 Jul 1996 14:18:01 GMT
Robert S. Thau wrote:
> 
>   There may be sites out
>   there who regularly kill -HUP the serverin case system resources start
>   getting taxed (i.e., resetting the scoreboard and throwing the number of
>   children back down to startservers).
> 
> Perhaps, but graceful restart has this effect anyway; it just takes slightly
> longer to achieve it.

Testing on my system is showing a problem here. The snag is that if I have
a debug message between the select() and the accept(), then the children all
die on the next connection. If I take the debugger out, then the children all
hang around for _ages_. I can only assume that the OS is cunningly triggering
multiple selects if the event hasn't been handled, but as soon as it has it
stops waking processes up.

Another problem occurs when graceful and non-graceful restarts are mixed. Now
that I've fixed it, a non-graceful restart works, but only if all children from
a prior graceful restart have died. Combined with the above problem this is
something of a headache.

It occurs to me that I can probably solve the first problem by actually killing
idle servers (with due attention to race conditions).

Thoughts?

>  In any case, even if there is a reason to preserve
> "ungraceful" behavior, it seems to me that "graceful" behavior should be
> the default for server restart (NB use of SIGHUP for this is a convention
> that extends well beyond Apache), and that it is ungraceful restart which
> should be on a different signal --- and preferably one other than SIGINT
> (for the reasons that Alexei has indicated) --- even SIGQUIT might be
> a better choice...

I just moved graceful restarts to SIGUSR1 for now...

BTW, even though a graceful restart does release logs and things eventually, it
won't interact well with log rotation scripts that want to do things like
compress the log as soon as it is rotated, or move it to a different file
system, or immediately analyze it. I fear this may preclude its immediate
decession. In the longer term, I guess such scripts need to be able to tell
when the resource really has been released (or rely on dodgy mechanisms such
as delaying for a long time).

I'm beginning to suspect that children from previous incarnations need to stay
on the scoreboard until they die, instead of being forgotten as they are now.

Cheers,

Ben.

> 
> rst

-- 
Ben Laurie                  Phone: +44 (181) 994 6435
Freelance Consultant and    Fax:   +44 (181) 994 6472
Technical Director          Email: ben@algroup.co.uk
A.L. Digital Ltd,           URL: http://www.algroup.co.uk
London, England.            Apache Group member (http://www.apache.org)

Mime
View raw message