Skip to content
uencoder

TCP_NODELAY

TCP_NODELAY disables Nagle's algorithm so small packets are sent immediately instead of waiting to be coalesced—lower latency, potentially more packets.

Purpose

It eliminates Nagle's 40 ms delay in interactive and real-time applications so small requests and responses go out at once.

Mechanism

Setting TCP_NODELAY=1 turns Nagle off, and every write goes on the wire immediately. Nagle by default batches small packets until an ACK arrives or an MSS fills up. Real-time applications (SSH/gaming/RPC) should disable it.

Use cases

  • Real-time interactive protocols
  • SSH and gaming
  • Low-latency RPC

Related tools

References