<div dir="ltr"><p class="MsoNormal"><span style="font-family:Arial,sans-serif;background-image:initial;background-repeat:initial">Hi Divya,</span><span style="font-family:Arial,sans-serif"></span></p>
<p class="MsoNormal"><span style="font-family:Arial,sans-serif"> </span></p>
<p class="MsoNormal"><span style="color:rgb(62,69,76);font-family:Helvetica,Arial,'lucida grande',tahoma,verdana,arial,sans-serif;font-size:12px;line-height:15.359999656677246px;white-space:pre-wrap;background-color:rgb(247,247,247)">I also have had a similar problem and stuck on it till now</span><span style="font-family:Arial,sans-serif">. I didn't use 1)
cos I used an unprivileged container. But I think your problem is </span><b><span style="font-family:Arial,sans-serif;color:black;background:rgb(249,249,249)">0x1001. </span></b><span style="font-family:Arial,sans-serif;color:black;background:rgb(249,249,249)">Try replacing with <b>0x00100001</b>. ( = 10:1)</span></p>
<p class="MsoNormal"><span style="font-family:Arial,sans-serif;color:black;background:rgb(249,249,249)">The format for
net_cls.classid is 0xAAAABBBB; AAAA is the major handle number and BBBB is the
minor handle number.</span><span style="font-family:Arial,sans-serif"></span></p>
<p class="MsoNormal"><b><span style="font-family:Arial,sans-serif;color:black;background:rgb(249,249,249)"><a href="http://serverfault.com/questions/435103/lxc-bandwidth-control-using-tc">http://serverfault.com/questions/435103/lxc-bandwidth-control-using-tc</a></span></b><span style="font-family:Arial,sans-serif"></span></p>
<p class="MsoNormal"><b><br></b></p><p class="MsoNormal">Hope this helps.</p></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 4, 2014 at 4:56 PM, Divya Vyas <span dir="ltr"><<a href="mailto:edivya.vyas@gmail.com" target="_blank">edivya.vyas@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div>Hi All,</div><div><br></div><div>I am running multiple containers and I want to limit the network bandwidth. </div>
<div>But I am not getting the desired output. Here is my method:</div>
<div><br></div><div><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
1) echo 0x1001 > /sys/fs/cgroup/lxc/<containerA>/net_cls.classid</pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
<br></pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
2) <span style="font-size:1em;line-height:1.2em">tc qdisc add dev br0 root handle 10: htb</span></pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
<span style="font-size:1em;line-height:1.2em"><br></span></pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
<span style="font-size:1em;line-height:1.2em">3) </span><span style="font-size:1em;line-height:1.2em">tc class add dev br0 parent 10: classid 10:1 htb rate 40mbit</span></pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
<span style="font-size:1em;line-height:1.2em"><br></span></pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
<span style="font-size:1em;line-height:1.2em">4) </span><span style="font-size:1em;line-height:1.2em">tc filter add dev br0 parent 10: protocol ip prio 10 handle 1: cgroup</span></pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
<span style="font-size:1em;line-height:1.2em"><br></span></pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
<span style="font-size:1em;line-height:1.2em">5) Used iperf to test the network bandwidth but not showing the desired output. </span></pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
<span style="font-size:1em;line-height:1.2em"><br></span></pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
<span style="font-size:1em;line-height:1.2em">I tried adding class to eth0 instead of br0 also but no change .</span></pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
<br></pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
Is anybody tried this kind of feature? I am not sure whether my testing procedure is wrong . </pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
<span style="font-size:1em;line-height:1.2em"><br></span></pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
<span style="font-size:1em;line-height:1.2em">Thanks,</span></pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
<span style="font-size:1em;line-height:1.2em">Divya</span></pre><pre style="font-family:monospace,monospace;padding:0px;border:0px none rgb(255,255,255);color:rgb(0,0,0);line-height:1.2em;font-size:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;margin-top:0px;margin-bottom:0px;vertical-align:top;background:none rgb(249,249,249)">
<span style="font-size:1em;line-height:1.2em"><br></span></pre></div></div>
</div><br></div>
<br>_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br></blockquote></div><br></div>