From: "Neil Aggarwal" Subject: Has anyone used tc to police traffic for VMs? Date: Fri, 10 May 2013 11:36:44 -0500 Message-ID: <001b01ce4d9c$8f2ef7e0$ad8ce7a0$@JAMMConsulting.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Return-path: Received: from mail.nsa-lp.com ([209.105.224.213]:56448 "EHLO mail.nsa-lp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754459Ab3EJQmt (ORCPT ); Fri, 10 May 2013 12:42:49 -0400 Received: from NeilHP (pool-71-96-131-109.dfw.dsl-w.verizon.net [71.96.131.109]) by mail.nsa-lp.com (Postfix) with ESMTPSA id 0DECF141962 for ; Fri, 10 May 2013 11:36:37 -0500 (CDT) Content-Language: en-us Sender: kvm-owner@vger.kernel.org List-ID: 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