Size per-socket send and receive buffers from the BDP, and total the kernel memory a server needs.
A socket buffer has to hold one BDP of unacknowledged data, plus the kernel's own per-packet structures — which is why Linux treats the value in tcp_rmem as including roughly a 2× overhead. Multiplying by the connection count gives the memory the box must have spare. Buffers set too small throttle every transfer to window ÷ RTT; set too large across thousands of sockets they exhaust kernel memory and trigger connection resets under load.
Socket Buffer
buffer = BDP × overhead factor, where BDP = bandwidth × RTT ÷ 8.
Server memory footprint
total kernel memory = per-socket buffer × concurrent sockets
buffer = BDP × overhead factor, where BDP = bandwidth × RTT ÷ 8. A socket buffer has to hold one BDP of unacknowledged data, plus the kernel's own per-packet structures — which is why Linux treats the value in tcp_rmem as including roughly a 2× overhead. Multiplying by the connection count gives the memory the box must have spare.
Buffers set too small throttle every transfer to window ÷ RTT; set too large across thousands of sockets they exhaust kernel memory and trigger connection resets under load.
This calculator takes 4 inputs: Bandwidth per socket, Round-trip time, Concurrent sockets, Kernel overhead factor. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.