TECHNOLOGY

Test small token writes against delayed acknowledgements

In this article
THE QUICK TAKE

Trace small writes through application buffers and socket options; Nagle, TCP_CORK and delayed acknowledgments require separate evidence.

A streaming server makes frequent small writes, but the receiving client observes bursts. TCP coalescing is one possible boundary to inspect after confirming the application actually submitted those writes. Nagle behavior, Linux corking and application-level buffering have different controls. Turning on TCP_NODELAY does not establish that every model token immediately becomes a separate packet.

Establish the write boundary

Record when the application submits bytes to the actual transport socket. A framework flush can stop at a userspace buffer, and TLS introduces another buffering layer. A successful send also does not confirm remote delivery. Without these boundaries, an apparent socket experiment may only measure a framework or proxy that never passed the small writes to TCP.

Locate outstanding small data

Nagle coalesces small writes when earlier data remains unacknowledged, subject to the protocol’s sending conditions. Delayed acknowledgments can interact with this pattern. Preserve acknowledgment timing and submitted write sizes in a controlled trace. A pause alone cannot distinguish this interaction from missing application output, congestion control or receiver flow control, all of which can delay bytes independently.

Check corking separately

Linux documents TCP_CORK as holding partial output until uncorking, with implementation-specific bounds. It takes precedence over ordinary TCP_NODELAY behavior, while setting NODELAY can explicitly flush pending output. Inspect the real socket options and library lifecycle rather than assuming a configuration name proves the resulting state. A temporary cork left across an unintended application boundary deserves its own explanation.

Compare a matched stream

Use the same synthetic byte sequence, write schedule, transport path and receiving client. Change the relevant option in an isolated comparison and retain arrival gaps, packetization and response completion. More packets can accompany lower small-write delay, so include the observed tradeoff. Do not infer that a setting which helps this stream improves bulk checkpoint transfer or every connection handled by the gateway.

Keep the conclusion local

A useful result identifies which layer held already-produced bytes and whether the selected option changed that behavior. It does not make network packets equivalent to tokens or SSE events. If bytes remain above the socket, investigate that buffering boundary first. If socket submission is prompt but delivery still stalls, retain the transport evidence without treating NODELAY as a universal latency switch.

Primary references

IETF TCP Specification.

Linux TCP Socket Options.

Linux send Message Submission Semantics.

Related reading: SSE and UTF-8: a network chunk is not a JSON event; GPU networking and availability: beyond internet speed.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles