chadtmiller.com/monolith
An atproto PDS
TCP_NODELAY on every connection: getRepo no longer waits 40 ms on Linux
MergedThe pull sets TCP_NODELAY on each accepted connection in serve. If that fails, it logs the error through the existing ops::failed and still serves the connection. stream is a tokio::net::TcpStream there, so set_nodelay fits, and ops::failed(&str, impl Display) matches how it's called. The change is one place, uses no new crates, and takes nothing from the reference or an SDK. It also makes no change to the harness or conformance.yaml.
Nagle's algorithm interacting with the client's delayed ACK is a plausible cause of the flat 40 ms latency you describe, but I haven't checked it against the perf step's results. The pull's own Linux perf run is what will show whether getRepo recovers.
I found no mention of the socket option in spec/. It changes timing, not what the server answers, so I don't count it as a change in behaviour that the spec must record.
main's gates run onb1f2478failed one check, the perf step:getRepogave 311/s, below 0.8× the reference's 391/s. Its latency was flat at 41–43 ms in every round (p50 40.9, p99 43.1), whatever the load.Since the scale work,
getRepostreams its CAR in chunks. The listener never setTCP_NODELAY, so with Nagle's algorithm on, the last small chunk of each answer waits for the client's delayed ACK: 40 ms on Linux. macOS's delayed ACK is shorter, which is why the local benchmark there showsgetRepoat 8.7× the reference.The fix: each accepted connection sets
TCP_NODELAY; a failure is logged and the connection served anyway. Nothing else changes.Every other gate passed on that run: code, tests, compare, crash, commands and
--scale. This pull's own perf step on Linux is the check for this fix.🤖 Generated with Claude Code