Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have been testing network throughput and latency and I was wondering if my measurements are as expected. For the test, I used Fedora 17 for both host and guest, using kernel 3.5.2-3.fc17.86_64.

Pinging an external server on the LAN from the host, using a gigabit interface, the results are:

# ping -c 10 172.16.1.1
PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
64 bytes from 172.16.1.1: icmp_req=1 ttl=64 time=0.109 ms
64 bytes from 172.16.1.1: icmp_req=2 ttl=64 time=0.131 ms
64 bytes from 172.16.1.1: icmp_req=3 ttl=64 time=0.145 ms
64 bytes from 172.16.1.1: icmp_req=4 ttl=64 time=0.116 ms
64 bytes from 172.16.1.1: icmp_req=5 ttl=64 time=0.110 ms
64 bytes from 172.16.1.1: icmp_req=6 ttl=64 time=0.114 ms
64 bytes from 172.16.1.1: icmp_req=7 ttl=64 time=0.112 ms
64 bytes from 172.16.1.1: icmp_req=8 ttl=64 time=0.117 ms
64 bytes from 172.16.1.1: icmp_req=9 ttl=64 time=0.119 ms
64 bytes from 172.16.1.1: icmp_req=10 ttl=64 time=0.128 ms

--- 172.16.1.1 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 8999ms
rtt min/avg/max/mdev = 0.109/0.120/0.145/0.011 ms

Pinging the same external host on the LAN from the guest, the latency seems to be much higher:

# ping -c 10 172.16.1.1
PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
64 bytes from 172.16.1.1: icmp_req=1 ttl=64 time=0.206 ms
64 bytes from 172.16.1.1: icmp_req=2 ttl=64 time=0.352 ms
64 bytes from 172.16.1.1: icmp_req=3 ttl=64 time=0.518 ms
64 bytes from 172.16.1.1: icmp_req=4 ttl=64 time=0.351 ms
64 bytes from 172.16.1.1: icmp_req=5 ttl=64 time=0.543 ms
64 bytes from 172.16.1.1: icmp_req=6 ttl=64 time=0.387 ms
64 bytes from 172.16.1.1: icmp_req=7 ttl=64 time=0.348 ms
64 bytes from 172.16.1.1: icmp_req=8 ttl=64 time=0.364 ms
64 bytes from 172.16.1.1: icmp_req=9 ttl=64 time=0.345 ms
64 bytes from 172.16.1.1: icmp_req=10 ttl=64 time=0.334 ms

--- 172.16.1.1 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 8999ms
rtt min/avg/max/mdev = 0.206/0.374/0.543/0.093 ms

(The LAN, the host and guest are idle otherwise during the tests.)

The vhost_net and macvtap modules are loaded on the host, and qemu was started (by libvirtd) with the -netdev vhost=on option.

Is this expected and normal, or do others see better latencies? Can I try anything to make it better? What latencies do others see?

share|improve this question

1 Answer 1

loaded modules do not mean a well configured VM. How exactly is the VM you are testing with set up?

Using RHEL 5, bridging and virtio_net, I get ~0.1ms latency between physical hosts and ~0.18ms latency when pinging from inside a VM. Simple bridge, no optimizations or alterations, and a pretty old RHEL 5 stack.

share|improve this answer
    
I have set up the vm using virt-manager. What do you mean by "well configured"? Would the config xml help? –  Balázs Pozsár Aug 28 '12 at 19:25
    
you could at least tell us whether you have iptables set up for forwarding and if you are using libvirt's bridge or NAT config –  dyasny Aug 28 '12 at 19:49
    
no iptables, and bridging is done via macvtap (so no NAT either) but I think I have tried all possible configurations and could not find any with better ping latency, it was the same with "simple bridging" also. what is your host-to-guest latency? –  Balázs Pozsár Aug 28 '12 at 20:15
    
I think what you really need to do is post these stats to the kvm mailing list and a BZ in Fedora. –  dyasny Aug 28 '12 at 20:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.