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

Re: [PATCH] docs: Recommend TCP_NODELAY (disabling Nagle)



On Tue, Jun 04, 2019 at 12:38:43PM -0500, Eric Blake wrote:
> On 5/30/19 2:08 PM, Eric Blake wrote:
> > This text from https://en.wikipedia.org/wiki/Nagle%27s_algorithm
> > is telling:
> > 
> > "In any request-response application protocols where request data can
> > be larger than a packet, this can artificially impose a few hundred
> > milliseconds latency between the requester and the responder, even if
> > the requester has properly buffered the request data. Nagle's
> > algorithm should be disabled by the requester in this case. If the
> > response data can be larger than a packet, the responder should also
> > disable Nagle's algorithm so the requester can promptly receive the
> > whole response."
> > 
> > And we hit it in real life with libnbd/nbdkit - more than an order of
> > magnitude in slowdown results when trying to saturate a connection
> > with as many parallel requests as possible when Nagle's algorithm
> > introduces artificial delay waiting for the ACKs:
> > https://www.redhat.com/archives/libguestfs/2019-May/msg00237.html
> > 
> > Signed-off-by: Eric Blake <eblake@redhat.com>
> > ---
> >  doc/proto.md | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> 
> Hearing no comments, I'll go ahead and push this.

Yes this had a dramatic positive effect on performance.  My
loopback-over-TCP test was literally 33 times faster after enabling
this.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html


Reply to: