<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">    It seems that there are two way to limit the network usage of containers. One is with <a href="https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/sec-net_cls.html" style="widows: 4; orphans: 4; font-size: 13px; border-bottom-width: 1px; border-style: none none dotted; margin: 0px; padding: 0px; vertical-align: baseline; outline: none; color: rgb(0, 51, 204); font-family: 'liberation sans', 'Myriad ', 'Bitstream Vera Sans', 'Lucida Grande', 'Luxi Sans', 'Trebuchet MS', helvetica, verdana, arial, sans-serif; line-height: 17.53333282470703px; ">net_cls</a> and the other one is <a href="https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/net_prio.html" style="widows: 4; orphans: 4; font-size: 13px; border-bottom-width: 1px; border-style: none none dotted; margin: 0px; padding: 0px; vertical-align: baseline; outline: none; color: rgb(0, 51, 204); font-family: 'liberation sans', 'Myriad ', 'Bitstream Vera Sans', 'Lucida Grande', 'Luxi Sans', 'Trebuchet MS', helvetica, verdana, arial, sans-serif; line-height: 17.53333282470703px; ">net_prio</a>ĄŁ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<div><br></div><div>set </div><div><div>     # net classid 1:10</div><div>     lxc.cgroup.net_cls.classid = 0x10010</div></div><div>in lxc config file and run tc.sh to setup tc queue discipline</div><div><br></div><div><div># cat tc.sh </div><div>tc qdisc add dev virbr0 root handle 1: htb</div><div>tc class add dev virbr0 parent 1: classid 1:10 htb rate 1kbit ceil 2kbit</div></div><div><br></div><div>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.</div><div><br></div><div>But in my test, network is not limited at all. What's wrong?</div><div><br></div><div><br></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>