Skip to content

Commit cfead68

Browse files
[codex] disable Nagle on Rendezvous WebSockets (#30269)
## Summary Disable Nagle unconditionally for both exec-server Rendezvous WebSocket connections. - pass `disable_nagle=true` at the executor and harness connection call sites - keep the existing signed URL, protocol, and connection flow unchanged - add no feature flag, rollout schema, path variant, or experiment-specific telemetry The companion internal PR enables `TCP_NODELAY` on accepted Rendezvous sockets: openai/openai#1082463 ## Why Rendezvous carries small, latency-sensitive relay and JSON-RPC frames. Three staging runs of 30 steady-state `process/read` calls per configuration measured p50 improving from 139.1 ms to 81.5 ms and p95 from 162.0 ms to 95.8 ms with Nagle disabled. The expected packet overhead is small at the current connection scale. We will use existing latency, error, packet, and CPU monitoring and revert normally if production regresses. ## Rollout and rollback The client and accepted-socket changes can deploy independently. New connections receive the setting as each side deploys. Rollback is a normal code revert; there is no persisted assignment or gate state to unwind. ## Validation - `just test -p codex-exec-server --lib`: 164 passed - `just fix -p codex-exec-server`: passed - `just fmt`: passed - independent final review found no actionable issue
1 parent 4808c16 commit cfead68

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

codex-rs/exec-server/src/client_transport.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,9 @@ impl ExecServerClient {
274274
connect_async_with_config(
275275
request,
276276
Some(noise_relay_websocket_config()),
277-
/*disable_nagle*/ false,
277+
// Rendezvous sends small, latency-sensitive frames, so avoid Nagle's coalescing delay.
278+
/*disable_nagle*/
279+
true,
278280
),
279281
)
280282
.await

codex-rs/exec-server/src/remote.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,9 @@ async fn connect_rendezvous(
561561
connect_async_with_config(
562562
request,
563563
Some(noise_relay_websocket_config()),
564-
/*disable_nagle*/ false,
564+
// Rendezvous sends small, latency-sensitive frames, so avoid Nagle's coalescing delay.
565+
/*disable_nagle*/
566+
true,
565567
)
566568
.await
567569
.map(|(websocket, _)| websocket)

0 commit comments

Comments
 (0)