To tune the kernel for better network performance, execute the following steps (for more information on what the kernel tunables are, read the How it works... section):
- Increase the max TCP send and receive socket buffer size:
root@kvm:~# sysctl net.core.rmem_maxnet.core.rmem_max = 212992root@kvm:~# sysctl net.core.wmem_maxnet.core.wmem_max = 212992root@kvm:~# sysctl net.core.rmem_max=33554432net.core.rmem_max = 33554432root@kvm:~# sysctl net.core.wmem_max=33554432net.core.wmem_max = 33554432root@kvm:~#
- Increase the TCP buffer limits: min, default, and max number of bytes. Set max to 16 MB for 1 GE NIC, and 32 M or 54 M for 10 GE NIC:
root@kvm:~# sysctl net.ipv4.tcp_rmemnet.ipv4.tcp_rmem = 4096 87380 6291456root@kvm:~# ...