Skip to content

Commit

Permalink
fix: disable Nagel's algorithm (#406)
Browse files Browse the repository at this point in the history
We do not expect to flood the network with small packets, so Nagel's
algorithms likely results in intermittent latency issues that can be
very difficult to debug
  • Loading branch information
Theodus authored Oct 17, 2023
1 parent a4ade6c commit bff919b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions graph-gateway/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ async fn main() {
IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),
metrics_port,
))
// disable Nagel's algorithm
.tcp_nodelay(true)
.serve(router.into_make_service())
.await
.expect("Failed to start metrics server");
Expand Down Expand Up @@ -354,6 +356,8 @@ async fn main() {
IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),
api_port,
))
// disable Nagel's algorithm
.tcp_nodelay(true)
.serve(router.into_make_service_with_connect_info::<SocketAddr>())
.await
.expect("Failed to start API server");
Expand Down

0 comments on commit bff919b

Please sign in to comment.