LXC in Ubuntu 12.04 LTS
stgraber.org
stgraber.org
Full virtualization like KVM or VMWare, require you to give each VM extra RAM for use with disk cache. For instance, if you had a typical set of processes that used 1.5GB, and you gave it 1.7GB, that would hardly be enough, as you want more than 200MB of disk cache.
Under LXC and OpenVZ, any unused RAM becomes globally available for disk caching, giving a decent performance boost and further reducing the resouce commitments per-VM.
One example: a customer had some lousy queries in their SQL, but they really needed to have a good demo of their site. We moved them to a 32GB RAM system and gave the container 8GB.
As a result, nearly the entire 20GB database (or at least the parts that were needed), got loaded into the disk cache after the first batch of queries were run. It was enough to get them over the hump (they later figured out the nasty SQL that was getting them in trouble) and they had a good demo. After that, we live-migrated back to their regular server.
Why not?
> Also, even in Xen, the ballooning can only be done in a range (I think not quite 4 times), so you can't set up 1GB and then balloon to 28GB, then go down to 1GB again.
I don't think kvm has that limitation.
I'd imagine that LXC has the potential to change that, though I presume it'll take some time for a) adoption to increase and b) for it to prove itself after that.
Namespaces is what is actually used. There are disk namespaces, network, pid, etc. Those are not very widely tested albeit supposed to be relatively secure.
FreeBSD jail provides a all-in-one integration instead. LXC provides the glue to achieve similar integration.
There is also rsbac_jail which provides an integration more similar to what FreeBSD does.
The major issue with LXC so far has been that it's not well integrated/easy to use.
LXC is to namespaces as "tc" is to traffic shaping.
It should be replaced.
but, a regular user can't create a namespace with root in it. that's what's missing for example.
Note that, again, RSBAC does support fully virtual users for example (akin to namespaces for users)
> What does this technology let me do that I can't do with stuff like virtualbox?
Fit more containers on your host :)
Share (disk and memory) resources among your containers
Make the same partition/directory/files available to a few containers at the same time without using ssh/nfs/smb/etc
... and so on.
what? cgroups provides resource limits.
LXC also has an under-appreciated mode where you can run some processes (but not a full OS) in a container.
Please elaborate, I'd like to try this out. I've been playing around with LXC for years, but assumed /sbin/init always had to be the root process.
In the 2nd half of 2011 other PaaS players caught on to the wonders of container virtualization - Heroku for example started using it with their Cedar stack in April of last year.
I am considering to use one of those for securing / hardening a set of VPSs I am using. Since I do not have debt with any of these tools, I would like to start with just one. The question is which one?
I would only use OpenVZ if there is a particular feature that it does better, and you can't afford to wait for LXC to catch up.
- Is LXC friendly with IDS/IPS and alike?
- If I place a webserver or a database in a container - what would be the implications in terms of set-up?
- Networking? How it would interact with iptables? iptables only on host, or it is possible to set-up separate iptables in each container?
- How logging is dealt with?
- Can system user sitting in the container escalate to root?
I am looking for a solution to further harden the set of VPSs for a web site/app.
Is LXC a good fit for that? Or smth else might be a better fit?
thank you
P.S.: my CFO experience can not help me here :-(
They sound quite similar in concept/execution.
If you plan on separating your app and database servers to different machines, doing so from the start may be a clever idea.
I think their great use is because they are soooo sim ple to create a new "host" one is willing to use configurations of servers, develop onto clusters early and so find the problems early
I would credit virtualisation with the rise of devops - seriously