tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: TCP connections clogging up accf_http(9) (was: ESTABLISHED sockets with no fd open?



> >Therefore, shouldn't there be (or am I just not seeing it?) sort of
> >a timeout that disposes of connections that have been sitting in the
> >accept filter for longer than $timespan?  Currently, we have to restart
> >lighttpd every so many days to cope with the slow but steady "leakage"
> >of connections...
> 
> if getsockopt(2) SO_KEEPALIVE is set for the peer socket then yes.
But there is no peer socket yet.  The connection is queued in the
kernel's accept filter, waiting to see a complete HTTP request before
the kernel even lets accept(2) return (or in our case, before kqueue
produces the "here's something to accept"-information.)

Or do you mean to SO_KEEPALIVE the listening socket?

> I'd normally expect the application to implement more meaningful timeout
> mechanisms given what it is doing/waiting for. I'd definitely expect it to
> be tuned for ~seconds rather than hours.
The application has no way to be aware of the connections sitting in the
accept filter, that's kind of the point of it.  For sockets it is actually
aware of, lighttpd certainly does implement timeouts.


Home | Main Index | Thread Index | Old Index