<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><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><br>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 class="im"><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>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>