frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

It's Always TCP_NODELAY

https://brooker.co.za/blog/2024/05/09/nagle.html
56•eieio•2h ago

Comments

eieio•1h ago
I found this article while debugging some networking delays for a game that I'm working on.

It turns out that in my case it wasn't TCP_NODELAY - my backend is written in go, and go sets TCP_NODELAY by default!

But I still found the article - and in particular Nagle's acknowledgement of the issues! - to be interesting.

There's a discussion from two years ago here: https://news.ycombinator.com/item?id=40310896 - but I figured it'd been long enough that others might be interested in giving this a read too.

miduil•26m ago
There is also a good write-up [0] by Julia Evans. We ran into this with DICOM storescp, which is a chatty protocol and TCP_NODELAY=1 makes the throughput significantly better. Since DICOM is often used in a LAN, that default just makes it unnecessarily worse.

[0]: https://jvns.ca/blog/2015/11/21/why-you-should-understand-a-...

[1]: https://news.ycombinator.com/item?id=10607422

kazinator•44m ago
> The bigger problem is that TCP_QUICKACK doesn’t fix the fundamental problem of the kernel hanging on to data longer than my program wants it to.

Well, of course not; it tries to reduce the problem of your kernel hanging on to an ack (or genearting an ack) longer than you would like. That pertains to received data. If the remote end is sending you data, and is paused due to filling its buffers due to not getting an ack from you, it behooves you to send an ack ASAP.

The original Berkeley Unix implementation of TCP/IP, I seem to recall, had a single global 500 ms timer for sending out acks. So when your TCP connection received new data eligible for acking, it could be as long as 500 ms before the ack was sent. If we reframe that in modern realities, we can imagine every other delay is negligible, and data is coming at the line rate of a multi gigabit connection, 500 ms represents a lot of unacknowledged bits.

Delayed acks are similar to Nagle in spirit in that they promote coalescing at the possible cost of performance. Under the assumption that the TCP connection is bidirectional and "chatty" (so that even when the bulk of the data transfer is happening in one direction, there are application-level messages in the other direction) the delayed ack creates opportunities for the TCP ACK to be piggy backed on a data transfer. A TCP segment carrying no data, only an ACK, is prevented.

As far as portability of TCP_QUICKACK goes, in C code it is as simple as #ifdef TCP_QUICKACK. If the constant exists, use it. Otherwise out of luck. If you're in another language, you have to to through some hoops depending on whether the network-related run time exposes nonportable options in a way you can test, or whether you are on your own.

anonymousiam•32m ago
The Nagle algorithm was created back in the day of multi-point networking. Multiple hosts were all tied to the same communications (Ethernet) channel, so they would use CSMA (https://en.wikipedia.org/wiki/Carrier-sense_multiple_access_...) to avoid collisions. CSMA is no longer necessary on Ethernet today because all modern connections are point-to-point with only two "hosts" per channel. (Each host can have any number of "users.") In fact, most modern (copper) (Gigabit+) Ethernet connections have both ends both transmitting and receiving AT THE SAME TIME ON THE SAME WIRES. A hybrid is used on the PHY at each end to subtract what is being transmitted from what is being received. Older (10/100 Base-T) can do the same thing because each end has dedicated TX/RX pairs. Fiber optic Ethernet can use either the same fiber with different wavelengths, or separate TX/RX fibers. I haven't seen a 10Base-2 Ethernet/DECnet interface for more than 25 years. If any are still operating somewhere, they are still using CSMA. CSMA is also still used for digital radio systems (WiFi and others). CSMA includes a "random exponential backoff timer" which does the (poor) job of managing congestion. (More modern congestion control methods exist today.) Back in the day, disabling the random backoff timer was somewhat equivalent to setting TCP_NODELAY.

Dumping the Nagle algorithm (by setting TCP_NODELAY) almost always makes sense and should be enabled by default.

martingxx•30m ago
I've always thought that Nagle's algorithm is putting policy in the kernel where it doesn't really belong.

If userspace applications want to make latency/throughput tradeoffs they can already do that with full awareness and control using their own buffers, which will also often mean fewer syscalls too.

kvemkon•11m ago
The tradeoff on one program can influence the other program needing perhaps the opposite decision of such tradeoff. Thus we need the arbiter in the kernel to be able to control what is more important for the whole system. So my guess.
vsgherzi•22m ago
https://oxide-and-friends.transistor.fm/episodes/mr-nagles-w...

oxide and friends episode on it! It's quite good

jonstewart•13m ago
<waits for animats to show up>
armitron•12m ago
Assuming he shows up, he'll still probably be trying to defend the indefensible..

Disabling Nagle's algorithm should be done as a matter of principle, there's simply no modern network configuration where it's beneficial.

rowanG077•11m ago
I fondly remember a simple simulation project we had to do with a group of 5 students in second year class which had a simulation and some kind of scheduler which communicated via TCP. I was appalled at the perfomance we were getting. Even on the same machine it was way too slow for what it was doing. After hours of debugging in turned out it was indeed Nagle's algorithm causing the slowness, which I never heard about at the time. Fixed instantly with TCP_NODELAY. It was one of the first times it was made abundantly clear the teacher at that institution didn't know what they were teaching. Apparently we were the only group that had a noticed the slow performance, and the teachers had never even heard of TCP_NODELAY.

Safety panel says NASA should have taken Starliner incident more seriously

https://arstechnica.com/space/2025/12/safety-panel-says-nasa-should-have-taken-starliner-incident...
1•dangle1•13s ago•0 comments

VIMKillerRecharged

https://github.com/caseykneale/VIMKillerRecharged
1•shakna•1m ago•0 comments

Authorization: Build vs. Buy (2024)

https://permify.co/post/authorization-buid-vs-buy/
1•mooreds•2m ago•0 comments

Pill Version of Wegovy Is Approved for Use in the U.S.

https://www.wsj.com/health/pharma/pill-version-of-wegovy-is-approved-for-use-in-the-u-s-6d6a6f2d
1•bookofjoe•3m ago•1 comments

Understanding the ForgeRock Password Storage Scheme (2024)

https://fusionauth.io/blog/forgerock-password-storage
1•mooreds•3m ago•0 comments

What's New in Miri

https://www.ralfj.de/blog/2025/12/22/miri.html
1•edmccard•5m ago•0 comments

Satellites reveal heat leaking from largest US cryptocurrency mining center

https://www.space.com/space-exploration/satellites/satellites-reveal-heat-leaking-from-largest-us...
1•troglo-byte•6m ago•0 comments

Amazing Sandbox (asb) – a Docker-based sandbox for running third-party code

https://github.com/ashishb/amazing-sandbox
1•ashishb•6m ago•0 comments

Self Media Decoder: media files that carry their own decoder logic (WASM)

https://github.com/jesusluque/SMD
2•jesusluque•7m ago•1 comments

Jupyter, ChatGPT, Copilot (Part 1): The Strategic Value of Thinking in Notebooks

https://omid.dev/2025/12/23/jupyter-the-strategic-value-of-thinking-in-notebooks/
1•omidfarhang•11m ago•0 comments

FCC bans foreign-made drones over national security, spying concerns

https://www.politico.com/news/2025/12/22/fcc-drone-ban-dji-00703742
3•mfiguiere•12m ago•0 comments

Show HN: Womoo – World Mood Logger

https://womoo.manhhung.app
2•mhpro15•15m ago•0 comments

MicroQuickJS by Fabrice Bellard

https://github.com/bellard/mquickjs
5•chunkles•15m ago•0 comments

Chemical Hygiene

https://karpathy.bearblog.dev/chemical-hygiene/
1•andy99•16m ago•0 comments

Rerun 0.28 – easier use with ROS style data

https://github.com/rerun-io/rerun/releases/tag/0.28.0
1•Tycho87•16m ago•1 comments

Show HN: A simple, free ticket/issue tracker for team collaborations

https://vibe.manhhung.app
1•mhpro15•17m ago•0 comments

Making complex web apps faster

https://blogs.windows.com/msedgedev/2025/12/09/making-complex-web-apps-faster/
2•rmason•18m ago•0 comments

Show HN: A repo to turn any model into a reasoning model without training

https://github.com/dl1683/Latent-Space-Reasoning
3•Dl1683•19m ago•0 comments

Zeroed Out

https://lukebechtel.substack.com/p/zeroed-out
1•lukebechtel•20m ago•0 comments

Ask HN: How do you design offline-first flows in large React Native apps?

2•samwellx•25m ago•0 comments

President unveils new 'Trump class' fleet of battleships

https://www.cnn.com/2025/12/22/politics/trump-shipbuilding-venezuela-tensions
1•p_ing•26m ago•2 comments

Will You Have a White Christmas This Year? (US & Canada)

https://www.nytimes.com/interactive/2025/12/22/weather/white-christmas-forecast-2025.html
1•ChrisArchitect•27m ago•1 comments

Nil, boosters, budgets: The athletic director simulator

https://www.espn.com/espn/feature/story/_/id/47036015/nil-boosters-budgets-athletic-director-simu...
1•1659447091•27m ago•0 comments

Tesla's Robotaxi project in Austin is much smaller than Musk claims

https://electrek.co/2025/12/22/tesla-robotaxi-project-austin-much-smaller-than-musk-claims/
2•kklisura•29m ago•0 comments

No more new foreign drones to be allowed in U.S. under FCC rules

https://financialpost.com/news/no-new-foreign-drones-allowed-in-u-s
2•xpe•29m ago•2 comments

What is a succinct data structure?

https://stackoverflow.com/questions/72580828/what-is-a-succinct-rank-data-structure-how-does-it-work
1•aarol•29m ago•0 comments

Conductor: Context-driven development for Claude Code

https://github.com/pilotparpikhodjaev/conductor_cc
1•tenxsengineer•32m ago•1 comments

Show HN: A small terminal metronome written in Go

https://github.com/knowareco/met
1•s3gm3nt•35m ago•0 comments

MRcutter

https://github.com/Ronny12345-art/MRcutter
1•Ronny12345-art•36m ago•1 comments

Perfusionist

https://en.wikipedia.org/wiki/Perfusionist
1•pndy•37m ago•0 comments