Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion codex-rs/exec-server/src/client_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,10 @@ impl ExecServerClient {
connect_async_with_config(
request,
Some(noise_relay_websocket_config()),
/*disable_nagle*/ false,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put a pr comment explaining this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rendezvous carries small, latency-sensitive relay and JSON-RPC frames. With Nagle enabled, a small write can wait for an ACK or for more data to coalesce, adding delay directly to request/response turns. In three staging runs of 30 steady-state process/read calls per configuration, setting TCP_NODELAY improved p50 from 139.1 ms to 81.5 ms and p95 from 162.0 ms to 95.8 ms.

We are accepting the modest increase in small packets because the current connection volume is low. Existing latency, error, packet, and CPU monitoring will catch regressions, and rollback is a normal code revert. The companion server change applies the same setting to accepted Rendezvous sockets: https://github.com/openai/openai/pull/1082463

// Relay traffic consists of small, latency-sensitive frames, so
// send them immediately instead of waiting for Nagle coalescing.
/*disable_nagle*/
true,
),
)
.await
Expand Down
5 changes: 4 additions & 1 deletion codex-rs/exec-server/src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,10 @@ async fn connect_rendezvous(
connect_async_with_config(
request,
Some(noise_relay_websocket_config()),
/*disable_nagle*/ false,
// Relay traffic consists of small, latency-sensitive frames, so send
// them immediately instead of waiting for Nagle coalescing.
/*disable_nagle*/
true,
)
.await
.map(|(websocket, _)| websocket)
Expand Down
Loading