Network Buffer Size Calculator
Calculate optimal socket send/receive buffer sizes based on bandwidth and latency.
About Network Buffer Size Calculator
To keep a TCP connection's throughput saturating the available bandwidth, the socket buffer must be at least as large as the bandwidth-delay product (BDP) — the volume of data that can be in flight before the first acknowledgment returns across the round-trip. Undersized buffers force the sender to stall waiting for ACKs, capping throughput well below the link's real capacity. Because each concurrent connection needs its own buffer allocation, the total kernel memory committed to networking scales linearly with connection count, which matters when sizing net.core.rmem_max/wmem_max on a server handling many simultaneous sockets.
Formulas
Bandwidth-delay product buffer size
buffer = bandwidth_Mbps × RTT_ms / 8 × 1000
- R
- bandwidth in Mbps
- T
- round-trip time in ms
Total kernel memory
total = buffer_per_connection × connections
- n
- concurrent connections
Worked example
With the default values below, Network Buffer Size Calculator returns Recommended Buffer per Connection of 6,103.52. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Link Bandwidthminimum 0 Mbps
- 1,000 Mbps
- Round-Trip Time (RTT)minimum 0 ms
- 50 ms
- Concurrent Connectionsminimum 1
- 100
Results
- Recommended Buffer per Connection
- 6,103.52 KB
- Total Kernel Memory for All Connections
- 596.05 MB
- Recommended Buffer per Connection
- 6,250,000 bytes
- Total Kernel Memory for All Connections
- 610,352 KB
Step by step
- 1Values used
- 2Bandwidth-delay product buffer size
- 3Total kernel memory
- 4Recommended Buffer per Connection= 6,103.52 KB
- 5Total Kernel Memory for All Connections= 596.05 MB
- 6Recommended Buffer per Connection= 6,250,000 bytes
- 7Total Kernel Memory for All Connections= 610,352 KB
Assumptions and limits
- The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 2 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Why divide by 8 in the bandwidth-delay product formula?
Bandwidth is conventionally measured in bits per second (Mbps) while buffer sizes are measured in bytes, so dividing by 8 converts bits to bytes before multiplying by the round-trip time to get a byte-denominated buffer size.
What happens if I set buffers larger than the calculated BDP?
Oversized buffers waste kernel memory across many connections and can increase latency under congestion (a phenomenon known as bufferbloat, where packets queue for longer than necessary before being dropped or delivered), so buffers should be sized close to the BDP rather than made arbitrarily large.
Where do I actually configure these buffer sizes on Linux?
The relevant sysctls are net.core.rmem_max and net.core.wmem_max for the system-wide ceiling, and net.ipv4.tcp_rmem / net.ipv4.tcp_wmem for the per-socket min/default/max triplet — set the max values at or above your calculated per-connection buffer size.
