July 16th, 2024

Golang is evil on shitty networks (2022)

The impact of Golang's default setting disabling Nagle's algorithm on network performance is discussed. Concerns include slow uploads, increased latency, and network saturation, questioning the decision's efficiency and suggesting considerations for optimization.

Read original articleLink Icon
Golang is evil on shitty networks (2022)

The article discusses the impact of Golang's default setting of disabling Nagle's algorithm, specifically focusing on its effects on network performance, particularly on unreliable networks. The author shares their experience with git-lfs uploads being slow even on 5Ghz networks due to TCP_NODELAY being set by default in Golang, leading to issues like packet overhead, increased latency, and network saturation. The decision to disable Nagle's algorithm in Golang is questioned, as it goes against the norm in other languages and can have significant consequences on network efficiency. The article delves into technical details about TCP_NODELAY, Nagle's algorithm, and their implications on network communication. The author also reflects on the historical context of TCP_NODELAY and its relevance in modern networking. The default setting in Golang is seen as a potential source of inefficiency and frustration for developers working with network-intensive applications. The article concludes by highlighting the broader impact of this default setting on various systems within the Go ecosystem and suggests considerations for when to enable or disable TCP_NODELAY based on network conditions.

Related

Interface Upgrades in Go (2014)

Interface Upgrades in Go (2014)

The article delves into Go's interface upgrades, showcasing their role in encapsulation and decoupling. It emphasizes optimizing performance through wider interface casting, with examples from io and net/http libraries. It warns about complexities and advises cautious usage.

Three ways to think about Go channels

Three ways to think about Go channels

Channels in Golang are locked, buffered queues for message passing. They integrate with goroutines, select blocks, and more, offering efficient concurrency. Understanding their role and benefits is crucial for Golang developers.

I Add 3-25 Seconds of Latency to Every Page I Visit (2020)

I Add 3-25 Seconds of Latency to Every Page I Visit (2020)

Reducing latency in web browsing can boost revenue in the consumer web industry. Intentionally adding latency to browsing activities can help curb addiction and enhance control over internet usage. Various methods like using specific browsers or tools are suggested.

Common Interface Mistakes in Go

Common Interface Mistakes in Go

The article delves into interface mistakes in Go programming, stressing understanding of behavior-driven, concise interfaces. It warns against excessive, non-specific interfaces and offers guidance from industry experts for improvement.

Beyond bufferbloat: End-to-end congestion control cannot avoid latency spikes

Beyond bufferbloat: End-to-end congestion control cannot avoid latency spikes

End-to-end congestion control methods like TCP and QUIC face challenges in preventing latency spikes, especially in dynamic networks like Wi-Fi and 5G. Suggestions include anticipating capacity changes and prioritizing latency-sensitive traffic for a reliable low-latency internet.

Link Icon 7 comments
By @zamadatix - 3 months
Some good previous discussion when this article came out, 373 comments including some commentary for John Nagle: https://news.ycombinator.com/item?id=34179426
By @chatmasta - 3 months
Maybe placebo effect, but I’ve found these sorts of issues disappear when I pump everything through a Wireguard connection (so all TCP is handled locally and multiplexed into UDP packets sent on the outbound connection).

Last time it happened was an `npm install` of a large repo that was stalling during parallel download step. This is on a 500mbps wired connection (though admittedly with a router that has some known issues with TCP congestion). When I enabled Wireguard the problem disappeared and the install completed with no choking.

By @tracker1 - 3 months
One thing I've often done for home/soho wifi setups is to use more narrow bands... instead of whatever the max signal band size is, I'd use a step down. This has generally resulted in a more consistent and stronger connection. It may not have as much max throughput in theory, but the experience has usually been much better.

Just my own experience.

By @alxjsn - 3 months