News for hackers. Stuff that matters.
Re:Golang is evil on shitty networks by Philip-J-Fry on Thursday December 29, 2022 @07:22PM (#34179999)
In my opinion, I think it's correct to be disabled by default.

I think Nagle's algorithm does more harm than good if you're unaware of it. I've seen people writing C# applications and wondering why stuff is taking 200ms. Some people don't even realise it's Nagle's algorithm (edit: interacting with Delayed ACKs) and think it's network issues or a performance problem they're introduced.

I'd imagine most Go software is deployed in datacentres where the network is high quality and it doesn't really matter too much. Fast data transfer is probably preferred. I think Nagle's algorithm should be an optimisation you can optionally enable (which you can) to more efficiently use the network at the expense of latency. Being more "raw" seems like the sensible default to me.

Re:Golang is evil on shitty networks by zamalek on Thursday December 29, 2022 @07:25PM (#34180015)
From the bottom of the article:

> Most people turn to TCP_NODELAY because of the “200ms” latency you might incur on a connection. Fun fact, this doesn’t come from Nagle’s algorithm, but from Delayed ACKs or Corking. Yet people turn off Nagle’s algorithm … :sigh:

Re:Golang is evil on shitty networks by Philip-J-Fry on Thursday December 29, 2022 @07:36PM (#34180105)
Yeah but Nagle's Algorithm and Delayed ACKs interaction is what causes the 200ms.

Servers tend to enable Nagle's algorithm by default. Clients tend to enabled Delayed ACK by default, and then you get this horrible interaction all because they're trying to be more efficient but stalling eachother.

I think Go's behavior is the right default because you can't control every server. But if Nagle's was off by default on servers then we wouldn't need to disabled Delayed ACKs on clients.

Re:Golang is evil on shitty networks by pclmulqdq on Thursday December 29, 2022 @08:06PM (#34180343)
Clients having delayed acks has a very good reason: those ACKs cost data, and clients tend to have much higher download bandwidth than upload bandwidth. Really, clients should probably be delaying acks and nagling packets, while servers should probably be doing neither.
Re:Golang is evil on shitty networks by charleslmunger on Thursday December 29, 2022 @11:08PM (#34181683)
Clients should not be nagling unless the connection is emitting tiny bytes at high frequency. But that's a very odd thing to do, and in most/all cases there's some reasonable buffering occuring higher up in the stack that the nagle's algorithm will only add overhead to. Making things worse are tcp-within-tcp things like http/2.

Nagle's algorithm works great for things like telnet but should not be applied as a default to general purpose networking.

Re:Golang is evil on shitty networks by avianlyric on Friday December 30, 2022 @06:31AM (#34184096)
Why would Nagles algorithm add delay to “reasonable buffering up the stack”? Assuming that buffering is resulting in writes to the TCP stack greater than the packet size, Nagles algorithm won’t add any delay.

The only place where Nagles algorithm adds delay is when your doing many tiny writes to a socket, which is exactly the situation you believe Nagles should be applied to.

Re:Golang is evil on shitty networks by avianlyric on Friday December 30, 2022 @06:37AM (#34184125)
The size of an ACK is minuscule (40 bytes) compared to any reasonable packet size (usually around 1400 bytes).

In most client situations where you have high down bandwidth, but limited up, that suggests the vast majority of data is heading towards the client, and client isn’t sending much outbound. In which case your client may end up delaying every ACK to maximum timeout, simply because it doesn’t often send reply data in response to a server response.

HTTP is clear example of this. Client issues a request to the server, server replies. Client accepts rely, but never sends any further data to the server. In this case, delaying the client ACK is just a waste of time.

Re:Golang is evil on shitty networks by Terretta on Thursday December 29, 2022 @08:31PM (#34180565)
Part of OPs point is 'most clients' do not have an ideal congestionless/lossless network between them and, well, anything.
Re:Golang is evil on shitty networks by fragmede on Thursday December 29, 2022 @09:16PM (#34180980)
Most clients that OP deals with, anyway. If your code runs exclusively in a data center, like the kind I suspect Google has, then the situation is probably reversed.
Re:Golang is evil on shitty networks by vitus on Thursday December 29, 2022 @09:53PM (#34181250)
If you run all of your code in one datacenter, and it never talks to the outside world, sure. That is a fairly rare usage pattern for production systems at Google, though.

Just like anyone else, we have packet drops and congestion within our backbone. We like to tell ourselves that the above is less frequent in our network than the wider internet, but it still exists.

Re:Golang is evil on shitty networks by oefrha on Thursday December 29, 2022 @09:58PM (#34181282)
If your DC-DC links are regularly as noisy as shitty apartment WiFi routers competing for air time on a narrow band, fix your DC links.
Re:Golang is evil on shitty networks by mmis1000 on Thursday December 29, 2022 @10:44PM (#34181530)
Consider the rising of mobile device. The devices that don't have a good internet is probably everywhere now.

It's no longer like 10 years ago. You either have good internet or don't have internet. The devices that have shitty network grow a lot compare to the past.

Re:Golang is evil on shitty networks by Karrot_Kream on Friday December 30, 2022 @12:16AM (#34182068)
Almost every application I've written atop a TCP socket batches up writes into a buffer and then flushes out the buffer. I'd be curious to see how often this doesn't happen.
Re:Golang is evil on shitty networks by mmis1000 on Friday December 30, 2022 @12:45AM (#34182215)
Are you replying to the correct people? I think I never mention how you should write a program. I only say that assume user have a good internet connection is a naive idea nowadays. (The gta 5 is the worst example in my opinion, lost of a few udp packets and your whole game exit to main menu. How the f**k the dev assume udp packets never lost?)
Re:Golang is evil on shitty networks by Karrot_Kream on Friday December 30, 2022 @02:22AM (#34182752)
What I mean to say is that, whether or not your mobile device has bad internet or not shouldn't matter. Most applications are buffering their reads and writes. This makes TCP_NODELAY a non-issue

Most importantly buffering doesn't spend a whole bunch of CPU time context switching into the kernel. Even if you are taking advantage of Nagle's, every call to write is a syscall, which calls into the kernel to perform the write. On a mobile device this would tank your battery. This is the main reason writes are buffered in applications.

Re:Golang is evil on shitty networks by vidarh on Friday December 30, 2022 @11:19AM (#34186442)
This is basically the first thing I check if diagnosing performance issues with network apps. Most probably are buffering now, but surprisingly many don't. MySQLs client library for years didn't for example (it's probably been fixed for a decade or more at this point).
Re:Golang is evil on shitty networks by jrockway on Friday December 30, 2022 @01:12AM (#34182381)
Why does a congestionless network matter here? Nagle's algorithm aggregates writes together in order to fill up a packet. But you can just do that yourself, and then you're not surprised. I find it very rare that anyone is accidentally sending partially-filled packets; they have some data and they want it to be sent now, and are instead surprised by the fact that it doesn't get sent now because their data doesn't happen to be too large to fit in a single packet. Nobody is reading a file a byte at a time and then passing that 1 byte buffer to Write on a socket. (Except... git-lfs I guess?)

Nagle's algorithm is super weird as it's saying "I'm sure the programmer did this wrong, here, let me fix it." Then the 99.99% of the time when you're not doing it wrong, the latency it introduces is too high for anything realtime. Kind of a weird tradeoff, but I'm sure it made sense to quickly fix broken telnet clients at the time.

Re:Golang is evil on shitty networks by throwawaylinux on Friday December 30, 2022 @02:26AM (#34182769)
Yeah it seems crazy to have that kind of hack in the entire network stack and on by default just because some interactive remote terminal clients didn't handle that behavior themselves.
Re:Golang is evil on shitty networks by iforgotpassword on Friday December 30, 2022 @03:15AM (#34183041)
Often times when people want to send five structs, they just call send five times. I find delayed acks a lot more weird compared to nagle.
Re:Golang is evil on shitty networks by another2another on Friday December 30, 2022 @07:26AM (#34184392)
In those cases it would be better to call writev() which was designed to coalesce multiple buffers into one write call.

How it sends the data is however up to the implementation, and whether it delays the last send if the TCP buffer isn't entitrely full I'm not sure - but it doesn't make sense to do so, so I would guess not.

https://linux.die.net/man/2/writev

Re:Golang is evil on shitty networks by tashbarg on Friday December 30, 2022 @03:54AM (#34183262)
It makes perfect sense if you consider the right abstraction. TCP connections are streams. There are no packets on that abstraction level. You’re not supposed to care about packets. You’re not supposed to know how large a packet even is.

The default is an efficient stream of bytes that has some trade-off to latency. If you care about latency, then you can set a flag.

Re:Golang is evil on shitty networks by Ferret7446 on Friday December 30, 2022 @04:47AM (#34183542)
There is no perfect abstraction. Speed matters. A stream where data is delivered ASAP is better than a stream where the data gets delayed... maybe... because the OS decides you didn't write enough data.

The default actually violates the abstraction more because now you care how large a packet is, because somehow writing a smaller amount of data causes your latency to spike for some mysterious reason.

Re:Golang is evil on shitty networks by avianlyric on Friday December 30, 2022 @06:19AM (#34184035)
> A stream where data is delivered ASAP is better than a stream where the data gets delayed

That depends on your situation, because as you say no abstraction is perfect. Having a stream delivered “faster” isn’t helpful if means your overhead makes up 50% of your traffic, exactly what nagle avoids.

Nagles algorithm is also pretty smart, it’s only going to delay your next packet until it’s either full, or the far end has acknowledged your preceding packet. If your got a crap ton of data to send, and you’re dumping straight into the TCP buffer, then Nagle won’t delay anything because there’s enough data to fill packets. Nagle only kicks in if you’re doing many frequent tiny writes to a TCP connection, which is rarely a valid thing to do if you care about latency and throughput, so Nagles algorithm assuming the dev has made a mistake is reasonable.

If you really care about stream latency, then UDP is your friend. Then you can completely dispense with all the traffic control processes in TCP and have stuff sent exactly when you want it sent.

Re:Golang is evil on shitty networks by avianlyric on Friday December 30, 2022 @06:28AM (#34184079)
> Nagle's algorithm aggregates writes together in order to fill up a packet.

Not quite an accurate description of Nagles algorithm. It only aggregates writes together if you already have in-flight data. The second you get back an ACK, the next packet will be sent regardless of how full it is. Equally your first write to the socket will always be sent without delay.

The case where you want to send many tiny packets with minimal latency doesn’t really make sense for TCP, because eventuality the packet overhead and traffic control algorithms will end up throttling your thought put and latency. Nagle only impact cases where you’re trying to TCP in an almost pathological manner, and elegantly handles that behaviour to minimise overheads, and associated throughput and latency costs.

If there’s a use case where latency is your absolute top priority, then you should be using UDP, and not TCP. Because TCP will always nobble your latency because it insists on ordered data delivery, and will delay just received packets if they arrive ahead of preceding packets. Only UDP gives you the ability to opt-out of that behaviour, and ensure that data is sent and received as quickly as your network allows, and lets your application decide for itself the handling of missing data.

Re:Golang is evil on shitty networks by p_l on Friday December 30, 2022 @06:36AM (#34184120)
Nagle's algorithm matters because the abstraction that TCP works on, and which was inherited by BSD Socket interface, is that of emulating a full duplex serial port.

Compare with OSI stack, where packetization is explicit at all layers and thus it wouldn't have such an issue in the first place.

Re:Golang is evil on shitty networks by dccoolgai on Thursday December 29, 2022 @11:43PM (#34181867)
"Be conservative in what you send and liberal in what you accept"

I would cite Postels Law: Nagle's is the "conservative send" side. An ACK is a signal of acceptance, and should be issued more liberally (even though it's also sent, I guess).

Re:Golang is evil on shitty networks by sneak on Thursday December 29, 2022 @07:32PM (#34180075)
> I'd imagine most Go software is deployed in datacentres where the network is high quality

The problem is that those datacenters are plugged into the Internet, where the network is not always high quality. TFA mentions the Caddy webserver - this is "datacenter" software designed to talk to diverse clients all over the internet. The stdlib should not tamper with the OS defaults unless the OS defaults are pathological.

Re:Golang is evil on shitty networks by tptacek on Thursday December 29, 2022 @07:47PM (#34180198)
That doesn't make much sense. There are all sorts of socket and file descriptor parameters with defaults that are situational; NDELAY is one of them, as is buffer size, nonblockingness, address reuse, &c. Maybe disabling Nagle is a bad default, maybe it isn't, but the appeal to "OS defaults" is a red herring.
Re:Golang is evil on shitty networks by Terretta on Thursday December 29, 2022 @08:38PM (#34180639)
You guys had this convo before, in 2015, on what the interaction of the two settings should be doing:

https://news.ycombinator.com/item?id=34180239

Re:Golang is evil on shitty networks by fragmede on Thursday December 29, 2022 @09:18PM (#34180996)
Re:Golang is evil on shitty networks by mdolah on Thursday December 29, 2022 @09:23PM (#34181030)
Love this historical find. How did you find this relevant conversation? Was this something with HN search?
Re:Golang is evil on shitty networks by subroutine on Friday December 30, 2022 @05:39AM (#34183782)
You haven't committed to memory every hn comment from Ptacek over the last decade?
Re:Golang is evil on shitty networks by Teckla on Thursday December 29, 2022 @08:04PM (#34180327)
In my opinion, the Principle of Least Surprise applies here.

Go is defaulting to surprising (unexpected) behavior.

Re:Golang is evil on shitty networks by giovannibajo1 on Thursday December 29, 2022 @08:24PM (#34180506)
I think also “least surprise” depends on your background. In Go, also files don’t buffer by default, contrary to many languages including C. If you call Write() 100 times, you run exactly 100 syscalls. Intermediate Go programmers learn this and that they must explicitly manage buffering (eg: via bufio).

I don’t think it’s wrong that sockets follow the same design. It gives me less surprise.

Re:Golang is evil on shitty networks by incompatible on Thursday December 29, 2022 @08:38PM (#34180642)
I think my C is getting rusty, but "write" operates on a file descriptor, doesn't it? It's unbuffered. The buffered versions are things like printf and puts.
Re:Golang is evil on shitty networks by tptacek on Thursday December 29, 2022 @08:47PM (#34180735)
That's POSIX; C's equivalent is a FILE, which generally is buffered.
Re:Golang is evil on shitty networks by Kab1r on Thursday December 29, 2022 @10:43PM (#34181528)
I thought Linux does in kernel buffering with `write`
Re:Golang is evil on shitty networks by blibble on Thursday December 29, 2022 @08:49PM (#34180760)
that Write() doesn't call fsync() though, does it?

so there's no buffering going on in the application, but the bytes almost certainly don't hit the disk before Write() returns

they've just been staged into an OS buffer, with the OS promising to write them out to the disk at a later time (probably, maybe...? hopefully!)

which is exactly the same as a regular TCP socket (with Nagle disabled, i.e. the default, non Go way)

Re:Golang is evil on shitty networks by Ferret7446 on Friday December 30, 2022 @04:53AM (#34183570)
For userland programming, what matters is the syscall level, as that is expensive (and also the API you have for the kernel). Whether the kernel then does internal buffering is irrelevant and uncontrollable beyond any other syscalls which may or may not be implemented (maybe you're running on a custom kernel that doesn't buffer disk writes?).

One write == one syscall, easy. If you want buffering, you add it.

Re:Golang is evil on shitty networks by blibble on Friday December 30, 2022 @12:16PM (#34187127)
> For userland programming, what matters is the syscall level, as that is expensive

which is why pretty much every programming language buffers file output by default

even C

(other than Go, obviously)

> Whether the kernel then does internal buffering is irrelevant

everyone that's attempted to write reliable software that cares about what ends up on disk, or the other side of the socket will disagree

Re:Golang is evil on shitty networks by pclmulqdq on Thursday December 29, 2022 @08:19PM (#34180468)
In my experience, you usually don't want to be Nagling in code that lives in a datacenter. Go's default is likely set up around that idea.
Re:Golang is evil on shitty networks by Xorlev on Thursday December 29, 2022 @08:25PM (#34180526)
Have you ever had to chase down strange latency issues? Arguably, this behavior is the least surprising for Go's typical deployment environment.
Re:Golang is evil on shitty networks by lanstin on Thursday December 29, 2022 @11:17PM (#34181722)
Twice I have run into this behavior having known and forgotten it. Chatty non http protocols with a few small messages doing with before bulk data flow. Pissed me off and surprised me. Now I make sure my defaults for any framework I am using are no delay, and I make sure to plug my computing device into Ethernet whenever possible.
Re:Golang is evil on shitty networks by squeaky-clean on Thursday December 29, 2022 @11:31PM (#34181812)
Only if you know that Nagle's algorithm exists and is used everywhere. For anyone with networking experience it's unexpected, but I still remember learning about Nagle's algorithm when trying to fix latency on a game server I was hosting as a teen. That was surprising behavior to me at the time.
Re:Golang is evil on shitty networks by jrockway on Tuesday January 03, 2023 @02:05PM (#34236316)
Articles with titles like "How I spent 3 weeks discovering that Nagle's Algorithm exists" are a HN staple. Turning off Nagle follows the principle of least surprise. This article is the first time anyone has ever written about being surprised by Nagle's Algorithm being off.
Re:Golang is evil on shitty networks by drpixie on Friday December 30, 2022 @12:17AM (#34182081)
Also, for small packets, disabling consolidation means adding LOTS of packet overhead. You're not sending 1 million * 50 bytes of data, you're sending 1 million * (50 bytes of data + about 80 bytes of TCP+ethernet header).

Disabling Nagle makes sense for tiny request/replys (like RPC calls) but it's counterproductive for bulk transfers.

I'm not the only one who don't like the thought of a standard library quietly changing standard system behaviour ... so know I have to know the standard routines and their behaviour AND I have to know which platforms/libraries silently reverse things :(

Re:Golang is evil on shitty networks by boring_twenties on Friday December 30, 2022 @01:42AM (#34182541)
Bulk transfer applications should just use larger buffers
Re:Golang is evil on shitty networks by josefx on Friday December 30, 2022 @01:55AM (#34182606)
Wouldn't that still end up with sub optimal network messages unless those large buffers are an exact multiple of the MTU on the network?
Re:Golang is evil on shitty networks by boring_twenties on Tuesday January 03, 2023 @09:49AM (#34232007)
Hm, I'm not 100% sure about this. If your first buffer is big enough, your next write should be issued before the OS has managed to write it all.
Re:Golang is evil on shitty networks by Animats on Thursday December 29, 2022 @07:51PM (#34180239)
The basic problem, as I've written before[1][2], is that, after I put in Nagle's algorithm, Berkeley put in delayed ACKs. Delayed ACKs delay sending an empty ACK packet for a short, fixed period based on human typing speed, maybe 100ms. This was a hack Berkeley put in to handle large numbers of dumb terminals going in to time-sharing computers using terminal to Ethernet concentrators. Without delayed ACKs, each keystroke sent a datagram with one payload byte, and got a datagram back with no payload, just an ACK, followed shortly thereafter by a datagram with one echoed character. So they got a 30% load reduction for their TELNET application.

Both of those algorithms should never be on at the same time. But they usually are.

Linux has a socket option, TCP_QUICKACK, to turn off delayed ACKs. But it's very strange. The documentation is kind of vague, but apparently you have to re-enable it regularly.[3]

Sigh.

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

[2] https://developers.slashdot.org/comments.pl?cid=14515105&sid...

[3] https://stackoverflow.com/questions/46587168/when-during-the...

Re:Golang is evil on shitty networks by rjbwork on Thursday December 29, 2022 @07:59PM (#34180294)
Gotta love HN. The man himself shows up to explain.
Re:Golang is evil on shitty networks by eddsh1994 on Thursday December 29, 2022 @11:20PM (#34181736)
For those like me who didn't know, GP designed Nagle's Algorithm in 1984 working at Ford Aerospace.
Re:Golang is evil on shitty networks by thiht on Friday December 30, 2022 @12:07AM (#34182018)
Imagine being on a math forum discussing Fermat’s theorem and the guy shows up.

This is such a cool aspect of CS being a young field: influent people are still alive!

Re:Golang is evil on shitty networks by Beltalowda on Friday December 30, 2022 @02:00AM (#34182623)
Andrew Wiles showing up would probably be the next best thing.
Re:Golang is evil on shitty networks by sillysaurusx on Friday December 30, 2022 @02:10AM (#34182678)
Russ also showed up. https://news.ycombinator.com/item?id=34181846

Readers might also enjoy his writeup on how google code search worked. https://swtch.com/~rsc/regexp/regexp4.html Just discovered it.

Re:Golang is evil on shitty networks by cbolton on Friday December 30, 2022 @07:41AM (#34184483)
Re:Golang is evil on shitty networks by tristanbvk on Friday December 30, 2022 @09:41AM (#34185423)
Can I show up for the future?
Re:Golang is evil on shitty networks by arkadiytehgraet on Friday December 30, 2022 @09:55AM (#34185578)
Fermat would probably get banned for too much trolling around the proof of his last theorem...
Re:Golang is evil on shitty networks by bsaul on Friday December 30, 2022 @04:38AM (#34183500)
i thought you mistyped your comment and wanted to reply to rsc ... then i clicked on animats profile. Yeah HN is becoming a treasure trove for CS.
Re:Golang is evil on shitty networks by matheusmoreira on Friday December 30, 2022 @10:10AM (#34185703)
Yeah, it's pretty cool. I'm gonna start saving these moments every time they happen. Last time I witnessed something like this was:

https://news.ycombinator.com/item?id=24455758

Re:Golang is evil on shitty networks by emmelaich on Thursday December 29, 2022 @09:01PM (#34180849)
Did the move from line oriented input to character input also occur around then?

I remember as a student, vi was installed and we all went from using ed to vi.

There was much gnashing and wailing from the admins of the VAX.

Re:Golang is evil on shitty networks by erosenbe0 on Friday December 30, 2022 @12:11AM (#34182033)
1984 would have been largely character if desired -- you already had desktop PCs with joystick and mouse too. The problem was the original party-line ethernet with large numbers of telnet clients or some other [nonstop, nonburst] byte-oriented protocol or serial hardware concentrator, which was a universal situation at educational institutions of the mid-to-late eighties. The Berkeley hack referred to above likely boosted the number of clients you could run on one ethernet sub with acceptable responsiveness.
Re:Golang is evil on shitty networks by silisili on Friday December 30, 2022 @02:24AM (#34182755)
Is this referring to Nagle on the server, and delayed ACK on the client?
Re:Golang is evil on shitty networks by renox on Friday December 30, 2022 @03:08AM (#34183006)
Thanks for this reply. What I find specially annoying is that the TCP client and the servers starts by a synchronization round-trip which is supposed to be used to synchronise options and this isn't the case here! Why can't the client and the servers agree on a sensible set of options (no delayed ack if the client is using the Nagle algorithm)??
Re:Golang is evil on shitty networks by sph on Friday December 30, 2022 @04:25AM (#34183421)
Any kernel engineer reading that can explain why TCP_QUICKACK isn't enabled by default? Maybe it's time to turn it on by default, if it was just a workaround for old terminals.
Re:Golang is evil on shitty networks by Matthias247 on Friday December 30, 2022 @04:51AM (#34183556)
Enabling it will lead to more ACK packets being sent, which leads to lower efficiency of TCP (the stack spends time in processing ACK packets) and lower link utilization (these packets also need space somewhere).

My thought is that the behavior is probably correct by default, since a receiver without knowledge of the application protocol is not able to know whether follow-up data will immediately, and therefore not able to decide whether it should send an ACK or wait for more data. It could wait for a signal from userspace to send that ACK - which is exactly what QUICKACK is doing - but that comes with the drawback of now needing an extra syscall per read.

On the sender side the problem seems solvable more efficiently. If one aggregates data in the application, and just sends as everything at once using an explicit flush signal (either using CORKing APIs or enabling TCP_NODELAY), no extra syscall is required while minimal latency can be maintained.

However I think it might be a good question on whether the delayed ACK periods are still the best choices for the modern internet, or whether much smaller delays (e.g. 5ms, or something along a fraction of the RTT) could be helpful.

Re:Golang is evil on shitty networks by Matthias247 on Friday December 30, 2022 @04:58AM (#34183592)
> The documentation is kind of vague, but apparently you have to re-enable it regularly.[3]

This is correct. And in the end it means more or less that setting the socket option is more of a way of sending an explicit ACK from userspace than a real setting.

It's not great for common use-cases, because making userspace care about ACKs will obviously degrade efficiency (more syscalls).

However it can make sense for some use-cases. E.g. I saw the s2n TLS library using QUICKACK to avoid the TLS handshake being stuck [1]. Maybe also worthwhile to be set in some specific RPC scenarios where the server might not immediately send a response on receiving the request, and where the client could send additional frames (e.g. gRPC client side streaming, or in pipelined HTTP requests if the server would really process those in parallel and not just let them sit in socket buffers).

[1] https://github.com/aws/s2n-tls/blob/46c47a71e637cabc312ce843...

Re:Golang is evil on shitty networks by wtarreau on Friday December 30, 2022 @10:35AM (#34185930)
TCP_QUICKACK is mostly used to send initial data along with the first ACK upon establishing a connection, or to make sure to merge the FIN with the last segment.
Re:Golang is evil on shitty networks by nextaccountic on Wednesday January 04, 2023 @02:18AM (#34242974)
How it's possible that delayed acks and nagle's algorithms are both defaults, anywhere? Isn't this a matter of choosing one, or another?
Re:Golang is evil on shitty networks by silisili on Thursday December 29, 2022 @08:37PM (#34180628)
Agreed. The post should be titled 'Go enables TCP_NODELAY by default', and a body may or may not even be needed. It's documented, even https://pkg.go.dev/net#TCPConn.SetNoDelay

To know why would be interesting, I guess. But you should be buffering writes anyways in most cases. And if you refuse to do that, just turn it back off on the socket. This is on the code author.

Re:Golang is evil on shitty networks by iofiiiiiiiii on Friday December 30, 2022 @01:53AM (#34182595)
> I've seen people writing C# applications and wondering why stuff is taking 200ms

I observe that in the most recent generation of its HTTP client (SocketsHttpHandler), .NET also sets NoDelay by default.

https://github.com/dotnet/runtime/blob/main/src/libraries/Sy...

Re:Golang is evil on shitty networks by kcartlidge on Friday December 30, 2022 @04:16AM (#34183367)
TIL - thanks!