Skip to content

Commit

Permalink
Add comment explaining why we set tcp_nodelay.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloneable committed Jan 2, 2025
1 parent 550123b commit 5561e16
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions proxy/src/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ impl ConnCfg {
connect_with_timeout(host, port).and_then(|stream| async {
let socket_addr = stream.peer_addr()?;
let socket = socket2::SockRef::from(&stream);
// Disable Nagle's algorithm to not introduce latency between
// client and compute.
socket.set_nodelay(true)?;
// This prevents load balancer from severing the connection.
socket.set_keepalive(true)?;
Expand Down

0 comments on commit 5561e16

Please sign in to comment.