[Twisted-Python] web site error

Jeremy Noetzelman jjn at kriln.com
Wed Oct 30 16:54:46 MST 2002


On Wed, 30 Oct 2002, Glyph Lefkowitz wrote:

> Well, it's not really leaking them.  As far as I can tell, the other end of the
> socket isn't closing the connection, so Twisted just keeps it open 'cause
> there's no timeout.  If there were a timeout, that would mean that proxying
> certain things through HTTP might break.  What I'm wondering is why _other_
> webservers don't suffer from this problem.  Do they have a timeout?  Is there
> something else happening in Twisted that I'm missing?  This is certainly a very
> frustrating bug to test for.  (After all, it's possible that this is some
> impossibly obscure errno that we're not accounting for, too...)

Generally, one would rarely want to have sockets that don't timeout.  To
have sockets without timeout opens a server up to easy DoS attacks.  I
can't imagine a time when you wouldn't want to time out sockets, even if
you're trying to tunnel something over HTTP.  If you pull out an ethernet
cable or a modem phone line, connections don't get closed either.  Any
assumption that connections will always close nicely is flawed.  Though,
maybe I'm misunderstanding what you mean by 'no timeout'

Personally, when I was running high volume web servers, we'd tune down the
keepalive timers to a fairly short interval to keep sockets from getting
tied up too long, to prevent resource availability issues that we were
seeing.

J





More information about the Twisted-Python mailing list