Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 15a1a3b

Browse files
committed
remove TcpStream::set_nodelay call
This is no longer necessary to avoid 40ms of extra response latency for `wasi:http@0.3.0-draft` components since we now poll the body stream before handing the response to Hyper. I still think the Nagle algorithm is a bad default, but I can make a separate PR to disable it. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
1 parent b4e74e7 commit 15a1a3b

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/commands/serve.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -579,12 +579,6 @@ impl ServeCommand {
579579
v = listener.accept() => v?,
580580
};
581581
let comp = component.clone();
582-
// Disable the Nagle algorithm, which can add 40ms of latency on
583-
// Linux machines if guest fails to provide response body data as
584-
// soon as Hyper needs it. The tradeoff here is that we may end up
585-
// sending more TCP packets if the guest is producing small body
586-
// chunks.
587-
stream.set_nodelay(true).unwrap();
588582
let stream = TokioIo::new(stream);
589583
let h = handler.clone();
590584
let shutdown_guard = shutdown.clone().increment();

0 commit comments

Comments
 (0)