Re: Question about KVM virtio network latency improvement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le 2016-10-13 09:00, Paolo Bonzini a écrit :

On 12/10/2016 17:27, Greg wrote:

Yes, you're partially right.
I've done some tests on how reduce interrupt latency. Using idle=poll or
use stress tests in guest permit to reduce half the latency (but is a
real hog on host :/).
Using "intel_idle.max_cstate=0 processor.max_cstate=0 idle=poll" on host
permits to get the same result (without cpu hog)

In conclusion, I get with theses results : ~120µs between guest (from
180µs previously).

Running iperf with these new modifications still get better results with
~60µs (a third from the initial value, half from idle=poll value).

Is there something else I can eventually tune ?

With a real workload, you might be able to get the same performance as
idle=poll thanks to KVM's automatic polling for interrupts.  As long as
packets are delivered within 400 microseconds, and only if there is no
other active process on the host's CPU, KVM will poll for guest
interrupts instead of putting the guest's CPU to sleep.

This of course doesn't trigger for ping, which only wakes up the guest
once per second.

Paolo

I agree with this, but don't seems to be reality : polling in enable on host and guest :

On host :
root@srv-kvm1:~# dmesg |grep "process: using polling idle"
[ 0.000000] process: using polling idle threads

On both guest :
root@Test1:~# dmesg |grep "process: using polling idle"
[ 0.000000] process: using polling idle threads
root@Test2:~# dmesg |grep "process: using polling idle"
[ 0.000000] process: using polling idle threads

Ping from Test1 to Test2 :
--- 192.168.0.22 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 8997ms
rtt min/avg/max/mdev = 0.117/0.133/0.144/0.010 ms

Ping from Test1 to Test2 with (iperf from Test2 to Test1 : iperf -c 192.168.0.21 -b 100M -t 60) :
--- 192.168.0.22 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 8998ms
rtt min/avg/max/mdev = 0.057/0.062/0.082/0.009 ms

Ping is almost twice as fast with an iperf running !
With iperf at 50kb/s : no change on ping, still ~130µs
Iperf at 100kb/s : the ping will vary with better and worst :
64 bytes from 192.168.0.22: icmp_seq=1 ttl=64 time=0.084 ms
64 bytes from 192.168.0.22: icmp_seq=2 ttl=64 time=0.124 ms
64 bytes from 192.168.0.22: icmp_seq=3 ttl=64 time=0.085 ms
64 bytes from 192.168.0.22: icmp_seq=4 ttl=64 time=0.116 ms
~ 110µs

At 200kb/s, ping improve to median at 77µs. At 500kb/s, ~70µs, 1M : ~68µs, 5M : ~65µs, 10Mb : ~60µs : 100Mb : 55µs (seems to be the best ping I can reach with my server)

Can you check on your server if you get the same behavior ?

Also could you give me a ping you've between two linux guest on the same host ? (I am far away from reality). Also, I remarks that booting a Windows 2012R2 on the same host slown down the ping of Linux guest. (loadavg 0,13, most of time idle is at 99%)

Best regards,
Grégory
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux