Skip to content

Tune Tokio TCP socket buffers#279

Closed
rgbkrk wants to merge 1 commit into
masterfrom
quod/tokio-tcp-buffer-tuning
Closed

Tune Tokio TCP socket buffers#279
rgbkrk wants to merge 1 commit into
masterfrom
quod/tokio-tcp-buffer-tuning

Conversation

@rgbkrk
Copy link
Copy Markdown
Member

@rgbkrk rgbkrk commented May 29, 2026

Summary

This creates a fresh, narrow PR inspired by the old #265 cloud-agent branch.

Changes:

  • request 4 MiB TCP receive and send socket buffers for Tokio TCP connections
  • apply the tuning on both outgoing connect() sockets and accepted listener sockets
  • keep the tuning best-effort by logging failures at debug level and continuing connection setup
  • leave non-Tokio runtime builds on the existing behavior through a no-op helper

Notes

This intentionally preserves socket semantics and public API shape. The only behavior change is the best-effort OS socket-buffer request on the Tokio TCP transport path.

Validation

rustfmt --edition 2021 --check src/transport/tcp.rs
cargo check --features tokio-runtime,tcp-transport
cargo check --no-default-features --features async-std-runtime,tcp-transport
cargo check --no-default-features --features async-dispatcher-runtime,tcp-transport,async-dispatcher-macros
git diff --check
cargo test --test connect --test large_message

@rgbkrk
Copy link
Copy Markdown
Member Author

rgbkrk commented May 29, 2026

Closing this duplicate in favor of #281. The two PRs have the same patch-id against current master, and #281 carries the fuller context/body for the TCP buffer tuning work.

@rgbkrk rgbkrk closed this May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant