httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Subject Re: [PATCH] lingering_close performance improvement
Date Wed, 12 Feb 1997 03:19:41 GMT
You can open a single socketpair() before forking that all children use to
send to the parent.  If the buffer isn't full (heh) then a write() of a
"small size" is atomic. 

Anyone know if POSIX promises that behaviour?  We actually already rely on
it -- all our log code assumes that write() for a "small size" is atomic
(and that the OS implements O_APPEND atomically as well, and that the
underlying fs allows the atomicity to work... i.e. not NFS). 

Not that I'm arguing for the parent loop... as Marc and I discussed in
private mail it's probably more scary to touch the parent at this stage
since you have to dink with SIGCLD so you can do select()s and clean up
children in parallel.


On Tue, 11 Feb 1997, Jim Jagielski wrote:

> Marc Slemko wrote:
> > 
> > On Tue, 11 Feb 1997, Jim Jagielski wrote:
> > 
> > > Unless we are fully multithreaded, doing this really puts a hurting
> > > on those systems with limited numbers of fd's :/
> > 
> > Passing fds back and forth between processes could, but with Dean's
> > suggestion of doing it all in the child you only have a minimal increase; 
> > they can still be thrown away almost (the resolution for how often we can
> > check in the child may not be frequent enough; one of the things I have to
> > look at later this week when I give it a try) as quickly, so you just have
> > less children holding close to the same number of fds. 
> > 
> Oh yeah... if done in the child then that's not a problem. I was assuming
> it was going to be done in the parent loop! That would be nasty
> since you would need to open a pipe (+1 fd) to grab the fd (+ another)
> for each lingering process (+ ??).
> They would add up quickly :)
> In any case, there are methods both in BSD and SysV to pass fd's
> between processes, although the SysV version is pretty rare :/
> -- 
> ====================================================================
>       Jim Jagielski            |       jaguNET Access Services
>           |
>                   "Not the Craw... the CRAW!"

View raw message