rust-libp2p icon indicating copy to clipboard operation
rust-libp2p copied to clipboard

feat(tcp): make `TCP_NODELAY` the default

Open mxinden opened this issue 2 years ago • 0 comments

Description

Make TCP_NODELAY the default. In other words, disable Nagle's algorithm.

Rational of Golang setting TCP_NODELAY as default: https://github.com/golang/go/issues/57530

Motivation

Trading low latency over throughput, especially when sending small messages.

Already our defacto default, see various examples using it: https://github.com/search?q=repo%3Alibp2p%2Frust-libp2p%20nodelay&type=code

Current Implementation

TCP_NODELAY is not the default.

https://github.com/libp2p/rust-libp2p/blob/a7d4cb30b05361713eb7d2deb8e410a0d88d2c51/transports/tcp/src/lib.rs#L168

Are you planning to do it yourself in a pull request ?

No

mxinden avatar Nov 18 '23 13:11 mxinden