Subject: [hybi] Encourage disabling Nagle in the standard text?

From: Adam Rice <[email-masked]>
Date: Wed, 19 Apr 2017 11:34:33 +0900

Numerous developers have run into issues when using WebSocket servers that
have the Nagle algorithm enabled [Citation:
https://www.google.com/search?q=websocket+nagle]. My impression is that
this ends up with most WebSocket servers disabling Nagle.

I am wondering if it would be better if the standard had text to the effect
that implementations SHOULD disable Nagle (ie. set TCP_NODELAY on the
socket).

Does anyone have any use cases where Nagle is beneficial?

For reference, Chrome always disables Nagle. pywebsocket doesn't (but
probably should).

---

From: Andy Green <[email-masked]>
Date: Wed, 19 Apr 2017 10:57:04 +0800

>For reference, Chrome always disables Nagle. pywebsocket doesn't (but

libwebsockets always disables Nagle... AFAIK there is no value to it for general ws use.  But I dunno it needs the standard changing, if things have higher than expected latencies people will probably work it out for themselves.

-Andy

---

From: Jacob Champion <[email-masked]>
Date: Tue, 18 Apr 2017 21:09:35 -0700

On 04/18/2017 07:57 PM, Andy Green wrote:
> libwebsockets always disables Nagle...

mod_websocket does too, simply because httpd disables it for all
connections.

> AFAIK there is no value to it for general ws use. But I dunno it
> needs the standard changing, if things have higher than expected
> latencies people will probably work it out for themselves.

Yeah. Seems like it would be subprotocol-specific... if I write a Telnet
clone over WebSocket, suddenly Nagle might make a lot of sense. But I'd
have to make sure to TCP_CORK my control frames so that they got flushed
through.

See also https://www.ietf.org/mail-archive/web/hybi/current/msg06895.html .

--Jacob

---

From: Andy Green <[email-masked]>
Date: Wed, 19 Apr 2017 13:04:48 +0800

>have to make sure to TCP_CORK my control frames so that they got

By coincidence in the last 3 weeks I have written both a telnet and an ssh server on top of libwebsockets (that runs on ESP32 via WLAN)... both work nicely without any special socket treatment and without nagle.

I think nagle can be helpful only under specific conditions, and over the years those conditions have become less of the norm.

-Andy

>
>See also
>https://www.ietf.org/mail-archive/web/hybi/current/msg06895.html .
>
>--Jacob
>
>_______________________________________________
>hybi mailing list
>[email-masked]
>https://www.ietf.org/mailman/listinfo/hybi

---

From: Adam Rice <[email-masked]>
Date: Wed, 19 Apr 2017 17:03:21 +0900

> See also https://www.ietf.org/mail-archive/web/hybi/current/msg06895.html

I fully agree with the sentiment expressed in this email from 6 years ago
:-)

I hate to see developers repeatedly trip over the same obstacle. I wish
someone 6 years ago had managed to sneak some non-normative verbiage into
the standard saying "by the way, you probably want to turn off Nagle".

Nitpick: The JS API does now support binary, and it's very popular.