Go to main content

Administering TCP/IP Networks, IPMP, and IP Tunnels in Oracle® Solaris 11.3

Exit Print View

Updated: March 2019

Changing the TCP Receive Buffer Size

The size of the TCP receive buffer is set by using the recv_buf TCP property, which is 128 KB by default. However, applications do not use available bandwidth uniformly. Thus, connection latency might require you to change the default size. For example, using the Secure Shell feature of Oracle Solaris causes overhead on bandwidth use because of the additional checksum and encryption processes that are performed on the data stream. Thus, the buffer size might need to be increased. Likewise, to enable applications that perform bulk transfers to use bandwidth efficiently, the same buffer size adjustment is also required.

You can calculate the correct receive buffer size to use by estimating the bandwidth delay product (BDP). To calculate BDP, multiply the available bandwidth by the value of the connection latency.

Use the ping –s host command to obtain the value of the connection latency.

The appropriate receive buffer size approximates the value of the BDP. However, the use of bandwidth also depends on a variety of conditions. A shared infrastructure or the number of applications and users that compete for the use of bandwidth can change that estimate.

Change the value of the buffer size as follows:

# ipadm set-prop -p recv_buf=value tcp

The following example shows how to increase the buffer size to 164 KB:

# ipadm show-prop -p recv_buf tcp
tcp   recv_buf   rw   128000       --        128000   2048-1048576

# ipadm set-prop -p recv_buf=164000 tcp

# ipadm show-prop -p recv_buf tcp
tcp   recv_buf   rw   164000    164000       128000   2048-1048576

No set value for the buffer size is preferred because the preferred size varies depending on the circumstance. Consider the following examples where different values are set for the BDP in each network with specific conditions:

Typical 1 Gbps local area network (LAN) where 128 KB is the default value of the buffer size:
BDP = 128 MBps * 0.001 s = 128 kB
Theoretical 1Gbps wide area network (WAN) with 100 ms latency:
BDP = 128 MBps * 0.1 s = 12.8 MB
Europe-to-U.S. link (bandwidth measured by uperf)
BDP = 2.6 MBps * 0.175 = 470 kB

    If you cannot compute the BDP, use the following guidelines:

  • For bulk transfers over a LAN, the default value of the buffer size (128 KB) is sufficient.

  • For most WAN deployments, the receive buffer size should be in the 2 MB range.


Caution  -  Increasing the TCP receive buffer size increases the memory footprint of many network applications.