[Lxc-users] limit network bandwidth with tc
Binknight
zheng_huabin at 163.com
Mon Oct 22 08:04:16 UTC 2012
It seems that there are two way to limit the network usage of containers. One is with net_cls and the other one is net_prio。The first one can be used with "tc" to limit bandwidth while the second one manipulate the priority of package sent from container. I've tried net_cls with tc by
set
# net classid 1:10
lxc.cgroup.net_cls.classid = 0x10010
in lxc config file and run tc.sh to setup tc queue discipline
# cat tc.sh
tc qdisc add dev virbr0 root handle 1: htb
tc class add dev virbr0 parent 1: classid 1:10 htb rate 1kbit ceil 2kbit
Note: The container use virbr0 created by libvirt as net interface, iptable is configured to make it possible to access server running inside the container from outside.
But in my test, network is not limited at all. What's wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20121022/4eea0570/attachment.html>
More information about the lxc-users
mailing list