Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Sep 2010 18:07:18 +0200
From:      Andre Oppermann <oppermann@networx.ch>
To:        Maxim Dounin <mdounin@mdounin.ru>
Cc:        freebsd-net@freebsd.org, Ian FREISLICH <ianf@clue.co.za>, Fabien Thomas <fabien.thomas@netasq.com>, freebsd-current@freebsd.org
Subject:   Re: TCP loopback socket fusing
Message-ID:  <4C8F9DB6.4050309@networx.ch>
In-Reply-To: <20100914103549.GI99657@mdounin.ru>
References:  <A9862681-6A4D-43A3-9A26-C71A54CF86F0@netasq.com> <4C8E0C1E.2020707@networx.ch> <E1OvSUd-0000mU-0l@clue.co.za> <20100914103549.GI99657@mdounin.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On 14.09.2010 12:35, Maxim Dounin wrote:
> Hello!
>
> On Tue, Sep 14, 2010 at 12:12:03PM +0200, Ian FREISLICH wrote:
>
>> Fabien Thomas wrote:
>>> Great,
>>>
>>> This will maybe kill the long time debate about "my loopback is slow vs
>>> linux"
>>> To have the best of both world what about a socket option to
>>> enable/disable fusing:
>>> can be useful when you need to see some connection "packetized".
>>
>> To chime in, I had a "slow" loopback issue earlier this week.  It
>> turned out the problem was caused by delayed ack on the loopback
>> where the client didn't need to transmit any data to the server.
>> It delayed each packet from the server by 100ms.  After patching
>> the server to:
>>
>> setsockopt(desc->accept_fd, IPPROTO_TCP, TCP_NODELAY,&x, sizeof(x));
>>
>> It's now faster than on linux.
>>
>> Perhaps this is one of the causes of "my loopback is slow vs linux".
>>
>> FWIW, I couldn't find a way to turn off dealyed_ack on just loopback
>> interface.
>
> AFAIK in linux delayed ack behaves a bit more gently and doesn't
> delay first ack(s) in a connection.  As a result linux hides some
> classic delayed ack vs. Nagle problems.
>
> Something similar probably should be adapted.

I saw something like that while glancing over the Linux code some
time ago.  Couldn't make much sense out of the code snipped because
their TCP code split into a myriad of small functions and thus hard
to follow in the beginning.  Not the ours is much easier on a beginner.

-- 
Andre



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C8F9DB6.4050309>