Network Performance Tuning

The process of determining the optimizations in this paper was in part drawn from past experience and from analysis of data captured during the execution of uperf.

This topic covers the operating system settings that will directly affect the networking performance in Linux® and KVM guests. Here is the list of all the settings that were changed from the operating system default settings.

Summary of used /proc settings

The following table is a list of all the settings (located in the /proc file system) that were used/adjusted to obtain the results contained in this paper.

Sysctl Variable Sysctl value
kernel.randomize_va_space 0
net.core.netdev_max_backlog 25000
net.core.rmem_max 4136960
net.core.wmem_max 4136960
net.ipv4.tcp_congestion_control cubic
net.ipv4.tcp_fin_timeout 1
net.ipv4.tcp_limit_output_bytes 131072
net.ipv4.tcp_low_latency 0
net.ipv4.tcp_max_tw_buckets 450000
net.ipv4.tcp_rmem 4096 87380 4136960
net.ipv4.tcp_tw_reuse 1
net.ipv4.tcp_wmem 4096 16384 4136960

Using Sysctl to override default settings

Rather than modifying system variables by echo-ing values in to the /proc file system directly,
[root@kvm(host|guest) ~] # echo "value" > /proc/sys/location/variable

the sysctl command is available to change system/network settings. Sysctl provides methods of overriding default setting values on a temporary basis for evaluation purposes as well as changing values permanently that persist across system restarts.

To display a list of all available sysctl variables, use the following command:
[root@kvm(host|guest) ~] # sysctl -a | less
To only list specific variables use:
[root@kvm(host|gFor ID uest) ~] # sysctl variable1 [variable2] [...]
To change a value temporarily use the sysctl command with the -w option:
[root@kvm(host|guest) ~] # sysctl -w variable=value
To override the value persistently, the /etc/sysctl.conf file must be changed. This is the recommend method. Edit the /etc/sysctl.conf file:
[root@kvm(host|guest) ~] # vi /etc/sysctl.conf
Then add/change the value of the variable:
[root@kvm(host|guest) ~] # variable = value
Save the changes and close the file. Then use the -p option of the sysctl command to load the updated sysctl.conf settings:
[root@kvm(host|guest) ~] # sysctl -p or sysctl -p /etc/sysctl.conf

The updated sysctl.conf values will now be applied when the system restarts.