TCP/IP performance tuning under KVM/Qemu

kvm-virtualizationqemutcpipvirtualization

With more and more companies switching to public cloud services, I'm curious what you guys' thoughts are on TCP/IP tuning in the cloud. Is it worth bothering with? Given that you don't have access to the host-server, you're somewhat limited I presume

Let's say for the sake of the argument that you're running three MongoDB-servers in a replica-set on FreeBSD or Linux that all sync over an internal network.

I'd also be curious if anyone made any actual performance benchmarks to back up their arguments. I benchmarked the various network drivers available for KVM/Qemu here, but I'm curious what the gurus here suggest to tune further.

I started playing around a bit with the tuning-recommendations as suggested over here, but interestingly enough I saw a decrease in performance, rather than an increase, but perhaps I didn't fully understand the tweaks.

Update: I did a few more benchmarks and posted the result here. Unfortunately the result wasn't really what I expected.

Best Answer

There are two points I'd like to make that may impact your conclusions.

1) review what is written about autotuning. This feature which, as I recall, first appeared in the 2.6.18 linux kernel and has been improved in in subsequent kernels. Put simply, what this does is allow the kernel to dynamically alter those tcp tweaks that network programmers got used to making. Google autotune linux. Also refer to http://www.psc.edu/networking/projects/tcptune/?_sm_byp=iVVq2rrM1N2DqN0r#Linux

The short version is let Linux adjust the tcp stack parameters for you and don't intervene as that may make performance worse.

My second point is check with version of KVM_QEMU you are using. There has been a lot of work with performance and there was a bug in earlier versions of VIRTIO_NET that limited performance on high speed networks. Since KVM_QEMU is at 1.0 now, go with that.