Re: [tcpm] draft-minshall-nagle

Jim Gettys <jg@freedesktop.org> Wed, 04 June 2014 17:33 UTC

Return-Path: <gettysjim@gmail.com>
X-Original-To: tcpm@ietfa.amsl.com
Delivered-To: tcpm@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 532491A0232 for <tcpm@ietfa.amsl.com>; Wed, 4 Jun 2014 10:33:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.277
X-Spam-Level:
X-Spam-Status: No, score=-1.277 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hmc2VPRs1gLd for <tcpm@ietfa.amsl.com>; Wed, 4 Jun 2014 10:33:48 -0700 (PDT)
Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com [IPv6:2607:f8b0:4003:c01::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A9B961A0141 for <tcpm@ietf.org>; Wed, 4 Jun 2014 10:33:48 -0700 (PDT)
Received: by mail-ob0-f176.google.com with SMTP id wo20so8026176obc.21 for <tcpm@ietf.org>; Wed, 04 Jun 2014 10:33:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=DIccZIEr8r+SimhTtJc4n1aC8my6a81JbkosoQQyS5M=; b=o6K+B73g3fahFv9RcmK6Svkn4nDJulK2X63p/6G1EQWP4ecxD4YPyVMTf/qMzhutCE WSEE8cXATnZhcqFZMkhOgTEesvytjxsvyCmEztj4LvfZ+f4WxVneqi5bwBiK/KIM8vaO 8cD+IsjlO/Lry+9ZedsoGQMsI6jlshftJsqwdul8XXK+xxO0/shouU+vIqMdJPMJyJ3x j32NwOCP27NzZpo/6G7ttw4S0TTPrrPaRgsPyiK8HnNnykMkZXxrUWwU0kkj4wJWrox+ /rFH2WTZkDMMCktebRtwye0m5VJzHM+7HXuPtMCVfuMt0wxgCASzN8E1Dz+Z/Rq/Pb+7 qw/Q==
MIME-Version: 1.0
X-Received: by 10.60.44.243 with SMTP id h19mr59547993oem.46.1401903222401; Wed, 04 Jun 2014 10:33:42 -0700 (PDT)
Sender: gettysjim@gmail.com
Received: by 10.76.73.100 with HTTP; Wed, 4 Jun 2014 10:33:42 -0700 (PDT)
In-Reply-To: <538F4F84.6040004@isi.edu>
References: <538D2BCC.8030906@mti-systems.com> <538DE3EA.2030104@isi.edu> <CADVnQy=Jmi10aFiSr1vnziY5bDNBv_W4+qhSkwMEiS4hSsRTkQ@mail.gmail.com> <538E00D9.4030802@isi.edu> <538E9094.4020205@mti-systems.com> <538F4F84.6040004@isi.edu>
Date: Wed, 04 Jun 2014 13:33:42 -0400
X-Google-Sender-Auth: kR6cRCQFw162Epn9qFa4fhhG2gA
Message-ID: <CAGhGL2ALS4DqCFLfUDMYeT1O_yXee5MZbodYFHNDVAF5RSHu6g@mail.gmail.com>
From: Jim Gettys <jg@freedesktop.org>
To: Joe Touch <touch@isi.edu>
Content-Type: multipart/alternative; boundary="001a11331cb094b4af04fb06078b"
Archived-At: http://mailarchive.ietf.org/arch/msg/tcpm/4G4Po0v7hRwennHlkbhICjG5k9g
Cc: "tcpm@ietf.org" <tcpm@ietf.org>
Subject: Re: [tcpm] draft-minshall-nagle
X-BeenThere: tcpm@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: TCP Maintenance and Minor Extensions Working Group <tcpm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tcpm>, <mailto:tcpm-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tcpm/>
List-Post: <mailto:tcpm@ietf.org>
List-Help: <mailto:tcpm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tcpm>, <mailto:tcpm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 04 Jun 2014 17:33:51 -0000

On Wed, Jun 4, 2014 at 12:55 PM, Joe Touch <touch@isi.edu> wrote:

>
>
> On 6/3/2014 8:20 PM, Wesley Eddy wrote:
>
>> On 6/3/2014 1:07 PM, Joe Touch wrote:
>>
> ...
>
>  My point is that even by the time of this paper, it was well-understood
>>> that Nagle should not be used in these environments. The paper cites
>>> 1999 personal communication with Jim Gettys for this, but it was
>>> well-known long before it was recited as an issue in this 1996 paper:
>>> http://ccr.sigcomm.org/archive/1997/apr97/ccr-9704-heidemann.pdf
>>>
>>
>> Even before that!  RFC 1122 (from 1989) says:
>>
>>     Some applications (e.g., real-time display window
>>     updates) require that the Nagle algorithm be turned
>>     off, so small data segments can be streamed out at the
>>     maximum rate.
>>
>
> I saw that, but it's more than for displays; it's actually anything
> *interactive* where the data unit is longer than one byte (e.g., Unicode
> telnet!).


​The history of the reference to me is the following:

1) Bob Scheifler and I had developed early versions of the X Window System.
2) when a new BSD release came out (or it may have been a new snapshot of
the network stack, as there was the BSD vs. BBN TCP stack wars going on),
performance of rubber band tracking got dramatically worse.

We tracked it down to the addition of Nagle: and shortly thereafter,
TCP_NODELAY was born: I don't remember whether Bob coded it up, or Mike
Karels.

Specifically, the delay of sending mouse event packets to applications over
the X protocol was terrible to interactive performance.  These mouse events
were around 24 bytes at the time, IIRC (X11 the events are 32 bytes).  As
the X server and client library do various forms of buffering, having the
OS get in the way is not good.  And you *never* want to delay interactive
traffic by anything on the timescale required to merge keystrokes, which,
as I remember, was the original intent of the optimization.

Unfortunately, I believe the default (being on) is wrong.  But it's far too
late to make that change.
​

>
>
>  The use case cited is quite dated - network news has been largely
>>> abandoned. Is there a currently relevant use case for this approach, and
>>> given that interactive apps already should be disabling Nagle, how much
>>> will it help?
>>>
>>
>>
>> I agree that disabling Nagle for "interactive" flows should be a
>> recognized best current practice.  (assuming they're aiming for
>> a packets/segments per second rate that isn't absurd)
>>
>> I think this would be a part of the "TCP Usage Guidelines"
>> analogue to RFC 5405 (for UDP) that Lars once thought about.
>>
>> Since Nagle is on by default in many OSes, and deciding to turn
>> it off means a developer has to know what it is, and that it's
>> even there to be turned off,
>>
>
> I didn't think O_NODELAY was all that cryptic...


​And many poor developers have been bit with it being on over the decades.
They naively think that data will be transmitted when you ask the operating
system.  It surprises them badly when it does not...
                                      - Jim

​

>
>
>
>  the Minshall tweak to Nagle does
>> seem to make it "more friendly" default to a diversity of
>> application behaviors (small writes, or odd patterns of writes),
>> while retaining the benefit of conserving packet count.
>>
>> I've noticed some people seem to have a tendency to disable Nagle
>> automatically, whether or not that's really necessary, since
>> maybe it bit them once in the distant past, and was difficult to
>> debug or understand.  The Minshall flavor stands a better chance
>> of not indoctrinating people against Nagle this way.
>>
>
> Nagle is useful in a very small use case that no longer exists - it's rare
> that we have interactive traffic that we know can be split at a byte
> boundary.
>
>
>  That said, this is not a burning problem.
>>
>
> Agreed.
>
> Joe
>
>
> _______________________________________________
> tcpm mailing list
> tcpm@ietf.org
> https://www.ietf.org/mailman/listinfo/tcpm
>