Top
Best
New

Posted by eieio 12/22/2025

It's Always TCP_NODELAY(brooker.co.za)
491 points | 179 commentspage 3
buybackoff 12/23/2025|
Then at a lower level and smaller latencies it's often interrupt moderation that must be disabled. Conceptually similar idea to the Nagle algo - coalesce overheads by waiting, but on the receiving end in hardware.
wyldfire 12/23/2025||
Nagle's algorithm is just a special case of TCP worst case latency. Packet loss and congestion also cause significant latency.

If you care about latency, you should consider something datagram oriented like UDP or SCTP.

mort96 12/23/2025|
What if occasional latency is fine, and latency on terrible networks with high packet loss is fine, but you want the happy case to have little latency? Both many (non-competitive) games and SSH falls into this: reliability is more important than achieving the absolute lowest latency possible, but lower latency is still better than higher latency.
bullen 12/23/2025||
What we need is configurable ack packet counts.

Then we can make TCP become UDP.

And then we solved everything.

Both linux and Windows have this config but it's buggy so we're back to TCP and UDP.

zbentley 12/23/2025|
I’m curious about this. Can you share more details or some links that discuss what you’re describing?
bullen 12/23/2025||
TcpAckFrequency and net.ipv4.tcp_delack_min but they don't do exactly what we need:

We need to be able to set it to -1 to tell the OS that no acks should be used at all, effectively turning that socket into UDP but with a TCP API!

That way we only have one protocol for ALL internet traffic.

I made a RFC about this a decade ago that was ignored.

TZubiri 12/23/2025||
> , suggesting that the default behavior is wrong, and perhaps that the whole concept is outmoded

While outmoded might be the case, wrong is probably not the case.

There's some features of the network protocols that are designed to improve the network, not the individual connection. It's not novel that you can improve your connection. By disabling "good neighbour" features.

harikb 12/23/2025||
Somewhat related, from 3 years ago. Unfortunately, original blog is gone.

"Golang disables Nagle's Algorithm by default"

1. https://news.ycombinator.com/item?id=34179426

withinboredom 12/23/2025|
Yeah. A disk failed, and I had to recreate the blog from whatever was still available via other means.
carlsborg 12/23/2025||
Unless you're cross platform on Windows too and then theres also a vast number of random registry settings.
joelthelion 12/23/2025||
What happens when you change the default when building a Linux distro? Did anyone try it?
hsn915 12/23/2025||
Wouldn't distributed systems benefit from using UDP instead of TCP?
0xbadcafebee 12/23/2025|
Only if you're sending data you don't mind losing and getting out of order
neomantra 12/23/2025||
This is true for simple UDP, but reliable transports are often built over UDP.

As with anything in computing, there are trade-offs between the approaches. One example is QUIC now widespread in browsers.

MoldUDP64 is used by various exchanges (that's NASDAQ's name, others do something close). It's a simple UDP protocol with sequence numbers; works great on quality networks with well-tuned receivers (or FPGAs). This is an old-school blog article about the earlier MoldUDP:

https://www.fragmentationneeded.net/2012/01/dispatches-from-...

Another is Aeron.io, which is a high-performance messaging system that includes a reliable unicast/multicast transport. There is so much cool stuff in this project and it is useful to study. I saw this deep-dive into the Aeron reliable multicast protocol live and it is quite good, albeit behind a sign-up.

https://aeron.io/other/handling-data-loss-with-aeron/

nospice 12/23/2025|||
Strictly speaking, you can put any protocol on top of UDP, including a copy of TCP...

But I took parent's question as "should I be using UDP sockets instead of TCP sockets". Once you invent your new protocol instead of UDP or on top of it, you can have any features you want.

wronex 12/23/2025|||
There is also ENet which is used in a lot of games (that is, battle tested for low latency applications.)

https://enet.bespin.org

jurabek 12/23/2025|
TCP_NODELAY enabled by default on most modern languages no?
More comments...