The merits of LXC containers

First of all what are containers? In this context we are referring to Linux running inside a “containerised” environment i.e. an environment which is to all intents and purposes isolated from the main operating system. The containerised environment doesn’t have it’s own kernel or virtualised hardware and runs at native speeds because of this.

In what ways could a containerised environment be useful and desirable from a business perspective? The first use that springs to mind is being able to easily move your dedicated server from one hoster to another (which is the way I use it). You can simply “rsync” the contents of the container from the source hoster, then take the container down, run another quick rsync and start the container at the new hoster. This is really useful, saving hours and possibly days rebuilding the server at the new hoster in a more conventional manner.

In a second scenario, if you have a Linux server running inside a containerised environment, you can upgrade/replace the hardware easily and with the minimum of downtime using rsync in the same way.

Currently the most popular container software is OpenVZ, however this is somewhat inelegant as you have to run a special kernel to use it. In itself this causes other problems like not being able to take advantage of features available in newer kernels or potential problems caused by external patches to the kernel. Ubuntu is moving away from OpenVZ and doesn’t support it in it’s current LTS (Long Term Support) release. LXC will become the de facto standard for containerisation in Linux for the simple reason that the Linux kernel already has LXC support built in. The following table compares OpenVZ, LXC and full virtualisation:-

Containerisation comparison

  LXC OpenVZ Full Virtualisation
Runs at native speeds Yes Yes No
Requires a special kernel No Yes No
Movable with minimal downtime Yes Depends on hoster Depends on hoster
Easy to configure No No Yes
Mature (comprehensive tools, etc.) No Yes Yes
Documentation Sparse Good Good
GUI No Yes Yes

So as you can see, LXC has a way to go to become as comprehensive and full featured as the incumbents. Over the next year or two I would expect LXC to come on in leaps and bounds in this respect – then there will be few reasons not to use it!

Leave a Reply