<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Hello,</div>
<div><br>
</div>
<div>I am using the host interfaces directly for my actual container :</div>
<div><br>
</div>
<div>E.g.:</div>
<div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(76, 47, 45);">
lxc.network.type = phys</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(76, 47, 45);">
lxc.network.flags = up</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(76, 47, 45);">
lxc.network.link = eth10.1.1</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(76, 47, 45);">
lxc.network.name = eth0</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(76, 47, 45);">
lxc.network.hwaddr = 00:50:56:b8:01:00</p>
</div>
<div><br>
</div>
<div>I am running either 1,4 or 32 hyper threaded cores per container without notable difference, at least in terms of startup time and CPU utilization.</div>
<div><br>
</div>
<div>Regards</div>
<div><br>
</div>
<div>Benoit</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Ranjib Dey <<a href="mailto:dey.ranjib@gmail.com">dey.ranjib@gmail.com</a>><br>
<span style="font-weight:bold">Reply-To: </span>"<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a>" <<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a>><br>
<span style="font-weight:bold">Date: </span>Friday, 24 January 2014 10:25<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a>" <<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [lxc-users] Speeding up containers startup<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">can you use the host network interface directly? i have not done it, but i know its possible. how many processes are running inside each container? if its very less, i think low cpu footprint is expected .. </div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Fri, Jan 24, 2014 at 12:55 AM, Benoit Lourdelet <span dir="ltr">
<<a href="mailto:blourdel@juniper.net" target="_blank">blourdel@juniper.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word">
<div>Hello,</div>
<span>
<div>
<div style="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word">
<div><br>
</div>
<div>I am running thousands of containers (1.0.0 beta2 kernel 3.11.9) – each with one physical interface-</div>
<div> and suffering from relatively slow startup rate : it takes 30 minutes to start 5000 containers.</div>
<div><br>
</div>
<div>During the startup period, the CPU is not busy (below 20%). There is no disk involved as I run on a RAM disk.</div>
<div><br>
</div>
<div>I know that transferring interfaces to a namespace takes time.</div>
<div><br>
</div>
<div>The following script takes 24 minutes on the same platform :</div>
<div><br>
</div>
<div>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(76,47,45)">date</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(76,47,45)">for i in $(seq 1 5000) </p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(76,47,45)"> do</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(76,47,45)">ip netns add sp$i</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(76,47,45)">ip link add a$i type veth peer name b$i</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(76,47,45)">ip link set a$i netns sp$i</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(76,47,45)">done</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(76,47,45)">Date</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(76,47,45)"><br>
</p>
</div>
<div>Starting 5000 containers without interface (only lo0) takes 11 minutes. So adding 24 to 11 is approximatively 30 minutes.</div>
<div><br>
</div>
<div>Is there a way to start the containers without interface at all and add the interfaces to the containers in a bulk fashion to speed up the processes ?</div>
<div><br>
</div>
<div>More generally is there a reason why container creation is not eating all the CPU ? The container creation processes takes between 10 or 20% of the host core CPU and no more.</div>
<div>Taking in account that no disk is involved as I run on a RAM disk.</div>
<div><br>
</div>
<div>Thanks</div>
<span class="HOEnZb"><font color="#888888">
<div><br>
</div>
<div>Benoit</div>
</font></span></div>
</div>
</span></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>
</div>
</div>
</span>
</body>
</html>