Skip to content

Commit 67b3f89

Browse files
committed
Disable Nagle on TCP socket: too slow for interactive
The wire-protocol is latency-bound, not bandwidth-constrained. So disable the Nagle algorithm to prevent large delays from hurting our performance too much. NOTE: Considering that we are implementing a request-reply protocol it might be possible to improve performance without disabling the Nagle algorithm. E.g. by taking control over buffering ourselves instead of leaving it up to the iostream class.
1 parent 9b3225f commit 67b3f89

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: src/connectors/wire/WireServer.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ void SocketServer::listen(const port_type port) {
1313
tcp::endpoint endpoint(tcp::v4(), port);
1414
acceptor.open(endpoint.protocol());
1515
acceptor.set_option(tcp::acceptor::reuse_address(true));
16+
acceptor.set_option(tcp::no_delay(true));
1617
acceptor.bind(endpoint);
1718
acceptor.listen(1);
1819
}

0 commit comments

Comments
 (0)