[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-discuss] Guest bandwidth setting
From: |
Robert N |
Subject: |
Re: [Qemu-discuss] Guest bandwidth setting |
Date: |
Sun, 30 Mar 2014 17:30:19 -0700 |
As for 'real-world' traffic shaping, there are various options, such as the
disk block i/o queuing
http://www.linux-kvm.org/wiki/images/7/72/2011-forum-keep-a-limit-on-it-io-throttling-in-qemu.pdf
/ http://wiki.qemu.org/Features/DiskIOLimits/Requirements .
But I personally do not know of a pre-existing throttling method for network
i/o within QEMU (maybe someone else does?) and have always used pre-existing
'standard' methods for network traffic shaping for bad guest prevention, WAN
testing (i.e. point to point microwave link simulation), application
performance evaluation, VoIP jitter, etc... NetEM is a fairly simple 'proxy' to
setup and then you can define the throughput of the ingress and egress adapters:
*> tc qdisc replace dev eth0 root handle 1:0 tbf rate 2.5Mbit burst 2048
latency 0ms
*> tc qdisc replace dev eth1 root handle 2:0 tbf rate 128kbit burst 2048
latency 0ms
But there are plenty of other traffic shaping options (open-source and not)
under Windows/OS-X and Linux.
You can also use Virtio devices within QEMU and apply shaping at the physical
level using standard hardware.
As far as sub-dividing packets, that is the wrong approach to take as you can
not apply time scaling to network traffic unless you control both sides and can
re-assembly the packets into it's original. You could do TCP rate control and
dynamically change the TCP window size and delayed ACK responses.
But if I wanted to mod qemu to provide this feature, using the 'leaky' or
'token' bucket transmission methods would be my preferred way and I'd would
just take one of the NIC emulations like ne2000.c as the base of a new NIC for
qemu and add leaky bucket queuing
(http://en.wikipedia.org/wiki/Leaky_bucket#Uses_2) to define a fixed bandwidth
rate. That could be done in a hour or two. I.e. pcnet.c has simple _receive and
_transmit functions and existing polling and poll delay routines that would be
a natural fit for queuing.
-R
________________________________
> Date: Sun, 30 Mar 2014 14:38:37 +0200
> From: address@hidden
> To: address@hidden
> Subject: [Qemu-discuss] Guest bandwidth setting
>
> Hi All,
>
> I am new to QEMU.
>
> I am implementing some functionality where in I need to set the
> bandwidth control for my guest vms.Please let me know how can I do it.
>
> I am looking into net/net.c file,I dint find any leads.I tried two ways.
>
> I am trying to find how to set virtual nics(in my case e1000) speed,I
> did not find any ways to do that.
>
> If I devide the packet into smaller packets in qemu_deliver_packet()
> function
> I am not able to transfer the other half of the packet.
>
> Please let me know how can I resolve this.
>
> Thanks in advance