[PATCH] Maintain outgoing TCP meta buffer
Scott Lamb
slamb at slamb.org
Sat Jan 14 19:36:15 CET 2006
On Jan 14, 2006, at 7:33 AM, Guus Sliepen wrote:
> Adding a buffer and testing for writablity will certainly prevent the
> problems that make BlockingTCP necessary. But, how large do we
> allow the
> buffers to grow? What do we do when it reaches a limit?
You're right: a limit definitely needs to be set. I've got enough
memory to throw at things, but I just tried simulating the worst
case: I took my Ethernet interface down and ran "ping -fs 65507
172.16.0.2". I thought it would realize the connection went down
before growing to be unreasonably large, but apparently not. In the
two and a half minutes before it pulled the plug, the buffer grew to
284 megs.
I'm tempted to address this by time rather than buffer size. Maybe if
it's had unflushed data for five seconds (which would be
configurable), it will terminate the connection as your code did
before. This would limit the buffer growth, and it'd make tinc notice
problems even if you stop filling the buffer.
Regards,
Scott
More information about the tinc-devel
mailing list