Thanks Ben for your advices. <br><br>Ok, let suppose that I use a single
container handling multiple requests. So can you describe a right
strategy to serve many applications at same time, in my naive thinking, I
would invoke such command like "<span style="font-family:courier new,monospace">lxc-execute -n <i>my-lxc-name</i> <i>command_to_execute args</i></span>", but is it possible to execute it simultaneously, as I see that when I started a container, I can't run <span style="font-family:courier new,monospace">lxc-execute</span> for this container from host machine.<br>
<br><div class="gmail_quote">On Thu, May 10, 2012 at 12:42 AM, Ben Butler-Cole <span dir="ltr"><<a href="mailto:ben@bridesmere.com" target="_blank">ben@bridesmere.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="im">On 8 May 2012 10:13, Đỗ Hoàng Khiêm <span dir="ltr"><<a href="mailto:dohoangkhiem@gmail.com" target="_blank">dohoangkhiem@gmail.com</a>></span> wrote:<br></div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Suppose that I want to build a system to serve many app. execution
requests from outside, and I want each app will have an isolated
environment to run, so each time process an execution request I have to
create a container for this request then execute app and destroy
container? Or create one container to serve all?<br>
</blockquote></div></div><div><br><div class="im">Unless your application really needs a
completely clean environment for each request, it is probably better to
have a single container handling multiple requests. Otherwise the
overhead of creating a new container will unnecessarily increase your
latency for each request and the load on your server.<br>
<br>There are advantages, though, in doing as you suggest and creating a
separate container for each application. It gives you an easy way to
impose strict isolation of the applications, constrain the resources
available to them and simplify management of them as atomic systems.<br>
<br></div></div><div class="im HOEnZb"><div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
If I create an own container for each app, is there any problem if many
apps run at same time, as I see that each container has its own rootfs
in /var/lib/lxc with size about 300MB in my machine (I've to installed
some additional packages, runtime environments in the container, eg.
Python, Ruby runtime env.), so 100 apps. run at same time will consume
about 30GB in hard drive?<br>
</blockquote></div><br></div><div class="HOEnZb"><div class="h5">You could possibly limit the disk space
required by using btrfs. But you need to consider the memory
requirements as well (and the CPU requirements if many of the
applications are likely to be handling requests at the same time).<br>
<br>100 applications (running in 100 separate containers) sounds like an awful lot to me.<br><br>-Ben<br><br>
</div></div></blockquote></div><br>