change tcp window sizes in linux

When dealing with various network cards and systems you may find it useful to verify or change the tcp window sizes of a system to ensure compatible communication of devices.

In linux you can easily view or change these parameters for both receiving and sending through proc.

[root@computer ~]# cat /proc/sys/net/core/rmem_max
131071
[root@computer ~]# cat /proc/sys/net/core/rmem_default
110592
[root@computer ~]# cat /proc/sys/net/core/wmem_max
131071
[root@computer ~]# cat /proc/sys/net/core/wmem_default
110592

You can easily modify window sizes by using echo to set an alternate value

[root@computer ~]# echo 131071 > /proc/sys/net/core/wmem_default
[root@computer ~]# cat /proc/sys/net/core/wmem_default
131071

Adjusting window sizes in this fashion will last until the next reboot. If you would like something to persist you may want to consider setting it in the /etc/sysctl.conf file

The default values are normally fine, but sometimes change is required to perform decently. Sometimes experimenting with the values to see what works best can help, since each network topology is different.

Be the first to comment

Leave a Reply