public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Has anyone used tc to police traffic for VMs?
@ 2013-05-10 16:36 Neil Aggarwal
  2013-05-11 15:00 ` Neil Aggarwal
  0 siblings, 1 reply; 2+ messages in thread
From: Neil Aggarwal @ 2013-05-10 16:36 UTC (permalink / raw)
  To: kvm

Hello:

I posted this question to the LARTC mailing list and apparently nobody
on that list has used tc to control traffic to VMs.  I am hoping someone
on this list has used it before and can help me.

I have a CentOS 6 server running two virtual machines using KVM.
Each machine has its own virtual device since I am using bridged
networking.

I am trying to allocate bandwidth to each virtual machine.

I have these rules set up:

/sbin/tc qdisc add dev v1262 ingress handle ffff:
/sbin/tc filter add dev v1262 parent ffff: protocol ip prio 50 u32 match ip
src 0.0.0.0/0 police rate 5mbit burst 500k mtu 3100 drop flowid :1

/sbin/tc qdisc add dev v1263 ingress handle ffff:
/sbin/tc filter add dev v1263 parent ffff: protocol ip prio 50 u32 match ip
src 0.0.0.0/0 police rate 5mbit burst 500k mtu 3100 drop flowid :1

You can see them when I do a qdisc ls:

qdisc ingress ffff: dev v1262 parent ffff:fff1 ----------------
qdisc ingress ffff: dev v1263 parent ffff:fff1 ----------------

The problem is when v1262 is doing a large upload, v1263 gets starved.

If I remove the ingress qdisc, v1263 runs at full speed regardless of what
v1262 is doing.

It's as if the two devices are using the same queue.  I did not think that
would happen since they are totally separate devices.

Has anyone been able to limit traffic separately to individual VMs?

Thanks,
  Neil

--
Neil Aggarwal, (972)834-1565, http://UnmeteredVPS.net/centos
Virtual private server with CentOS 6 preinstalled
Unmetered bandwidth = no overage charges




^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: Has anyone used tc to police traffic for VMs?
  2013-05-10 16:36 Has anyone used tc to police traffic for VMs? Neil Aggarwal
@ 2013-05-11 15:00 ` Neil Aggarwal
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Aggarwal @ 2013-05-11 15:00 UTC (permalink / raw)
  To: kvm

Hello:

> Has anyone been able to limit traffic separately to individual VMs?

I just figured out libvirt has bandwidth controls in the guest machine's
configuration.  I tried it and it worked.  Looking at the qdisc ls report,
it apparently uses tc to achieve the limiting so I am not sure why my
manual commands did not work but now I guess it does not matter.

Thanks,
  Neil

--
Neil Aggarwal, (972)834-1565, http://UnmeteredVPS.net/centos
Virtual private server with CentOS 6 preinstalled
Unmetered bandwidth = no overage charges


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-11 15:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-10 16:36 Has anyone used tc to police traffic for VMs? Neil Aggarwal
2013-05-11 15:00 ` Neil Aggarwal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox