If you have been following our TCP Performance Tuning series, you'll know that we want to enable RFC 1323 Window Scaling and increase the TCP window size to 1 MB. To do this, we'll add the following lines to /etc/sysctl.conf
and issue sudo sysctl -p
to apply the changes immediately.
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.rmem_default = 1048576
net.core.wmem_default = 1048576
net.ipv4.tcp_rmem = 4096 1048576 16777216
net.ipv4.tcp_wmem = 4096 1048576 16777216
net.ipv4.tcp_congestion_control = bic
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 1
As before, we're setting the maximum buffer size large and the default window size to 1 MB. RFC 1323 is enabled via net.ipv4.tcp_window_scaling
and net.ipv4.tcp_timestamps
. These options are probably on by default, but it never hurts to force them via /etc/sysctl.conf
. Finally, we are choosing BIC as our TCP Congestion Control Algorithm. Again, that value is most likely the default on your system (especially any kernel version after 2.6.12).
Hello,
I am doing my project on live migration of virtual machine using xen and kvm with 100Mbps link. I want to increase the transfer rate,so what values can I set in sysctl.
I tired with the values but it is not showing any change.Pls help me with that.
regards,
Digvijay
Digvijay -
What's the latency between the two hosts?
0.79 ms
With latency that low, these TCP tuning tips are probably not going to apply. If you're using something like SSH to perform the copy, you might consider a combination of nc and dd.
Thanx Sir.Sir but what can I do so that my live migration occurs with minimum time.
Well, you might try lvmsync.