Skip to content

bug: iroh-relay's server side doesn't set the TCP socket to no-delay #3974

@ISensuiI

Description

@ISensuiI

Describe the bug

Source code evidence

Iroh-relay

  • Client-side configuration: client/tls.rs L156 and L188 both have tcp_stream.set_nodelay(true)

  • Server-side missing: server/http_server.rs L362 has no call after listener.accept()

Relevant Logs

Expected behavior

Iroh

Version: 0.96.0 All of the previous versions exist.

Platform(s)

All

Additional Context / Screenshots / GIFs

My current solution is patching.

res = listener.accept() => match res {

Ok((stream, peer_addr)) => {

debug!("connection opened from {peer_addr}");

stream.set_nodelay(true).ok();

These are my previous test records of specific latency and test results.

#3699

#3670

The final result, which I have attached to the screenshot, shows that the latency dropped directly from 300-400ms to 140-150ms. This is the result I ultimately hoped for in the discussion forum: 70ms * 2

If possible, I would like to add nagle to the server configuration. Algorithm configuration options control whether the relay service is enabled on Nagle. This is a crucial option for latency-sensitive applications with frequent small packet transmissions.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingc-irohFunctionality of the core iroh crate.c-iroh-relayFunctionality of the iroh-relay server.

    Type

    Projects

    Status

    ✅ Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions