Romain Hardouin
2014-Aug-12 17:37 UTC
[libvirt-users] [qemu-kvm] Network bandwidth limits via libvirt
Hi all, I try to understand why the interface bandwidth limits are not applied to my Ubuntu 12.04 VM (qemu-kvm driver) and I would need some insights. I spawn my VM with OpenStack and when I issue a dumpxml on my domain, I can see that bandwidth limits are set: <interface type='ethernet'> <mac address='02:68:b5:c6:fa:a5'/> <bandwidth> <inbound average='500' peak='500' burst='1000'/> <outbound average='500' peak='500'/> </bandwidth> <script path=''/> <target dev='tap68b5c6fa-a5'/> <model type='virtio'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> However when I send a big file with scp I don't see any limits applied to the transfer rate. I've checked the domain log and I didn't see any qemu command line argument related to bandwidth limits. Should I expect to see a specific argument like "bps_wr" for IO limits? Also, should I expect to see something in particular under the cgroup directory for the qemu instance? Or do network limits are managed in another way than with cgroups? Below some information about my hypervisor: % virsh -V Virsh command line tool of libvirt 1.2.2 See web site at http://libvirt.org/ Compiled with support for: Hypervisors: QEMU/KVM LXC UML Xen LibXL OpenVZ VMWare VirtualBox Test Networking: Remote Network Bridging Interface netcf Nwfilter VirtualPort Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM RBD Sheepdog Miscellaneous: Daemon Nodedev AppArmor Secrets Debug Readline Modular qemu-kvm: 2.0.0 Kernel: 3.2.0-64-generic Any hints will be appreciated :) Thanks, Romain
Laine Stump
2014-Aug-13 13:53 UTC
Re: [libvirt-users] [qemu-kvm] Network bandwidth limits via libvirt
On 08/12/2014 01:37 PM, Romain Hardouin wrote:> Hi all, > > I try to understand why the interface bandwidth limits are not applied to my Ubuntu 12.04 VM (qemu-kvm driver) and I would need some insights. > I spawn my VM with OpenStack and when I issue a dumpxml on my domain, I can see that bandwidth limits are set: > > <interface type='ethernet'>What is the reason for using <interface type='ethernet'> instead of type='bridge'? In general, type='ethernet' is intended to be used only as a last resort if a more supported type (pretty much anything else, except 'user') can't do what is needed. That is the reason you're not seeing the effects of the <bandwidth> element - <bandwidth> only affects interface types of 'bridge', 'network', or 'direct' (source: I just checked the code). In theory there's no reason I know of that we shouldn't make it work on type='ethernet', but due to the relative "unsupportedness" of type='ethernet', nobody has noticed before now.