chadtmiller.com/monolith
An atproto PDS
0
0
TCP_NODELAY on every connection: getRepo no longer waits 40 ms on Linux
crates/pds-server/src/limits.rs+6−0
| @@ -898,6 +898,12 @@ pub(crate) async fn serve<T>( | ||
} | ||
}, | ||
}; | ||
// Answers are written as they are made, a streamed `getRepo` in | ||
// chunks: without this its last small chunk waits on the client's | ||
// delayed acknowledgement, 40 ms on Linux. | ||
if let Err(e) = stream.set_nodelay(true) { | ||
crate::ops::failed("setting TCP_NODELAY", e); | ||
} | ||
let (app, open, mut stopped) = (app.clone(), open.clone(), stopped.clone()); | ||
tokio::spawn(async move { | ||
let service = hyper::service::service_fn(move |req: Request<hyper::body::Incoming>| { | ||