Subject: Re: TCP_NODELAY in telnet (Re: CVS commit: src)
To: Perry E. Metzger <perry@piermont.com>
From: Ian Lance Taylor <ian@airs.com>
List: tech-net
Date: 06/16/2003 16:50:49
"Perry E. Metzger" <perry@piermont.com> writes:

> Ian Lance Taylor <ian@airs.com> writes:
> > It would clearly be wrong for telnet to turn off Nagle's algorithm.
> > Nagle's algorithm was basically designed for telnet, to prevent each
> > character typed from generating a new packet.
> 
> One wonders if, given that more apps seem to have performance issues
> with Nagle's algorithm than need it, if we shouldn't invert the sense
> and explicitly set Nagling for rlogin and telnet and disable it for
> other applications.

It is appropriate to use Nagle's algorithm for any application which
produces a bunch of short packets.  This includes any application
which doesn't use a single write() (or writev()) to send a bunch of
data, but which uses a bunch of write() calls instead.  In the absence
of Nagle's algorithm, each write() call will tend to produce a packet.
There are probably many such applications, since it's the easy to
write code if you don't care about efficiency.  So I would be cautious
about disabling Nagle by default.  I personally think it's reasonable
to require applications which require efficiency to do a little extra
work to get it in some situations.

Ian