Jump to content

Out of curiosity, what do you guys prefer?

 

I currently have 3 linux (debian and ubuntu) VMs running through KVM on an Ubuntu host. Ive been looking to LXC (containerization) as an alternative in order to save resource shares on my host hardware. I wanted to ask if anybody has any experience with LXC and how is resource use in comparison to KVM (or any other virtualization method for that matter)?

 

While i'm on the topic, how does networking get handled with LXC? Say I wanted one container to run an MySQL server and another container to NGINX or Apache2. I'm assuming I'll loose all advanced networking features as the applications are bound directly to the host interface(s)? Is there any way around that (other than using reverse proxying)?

 

Does anybody here have a working setup that they have posted about wither here on the forum or on their blog/website? I'd like to read up more on LXC before I jump in.

▶ Learn from yesterday, live for today, hope for tomorrow. The important thing is not to stop questioning. - Einstein◀

Please remember to mark a thread as solved if your issue has been fixed, it helps other who may stumble across the thread at a later point in time.

Link to comment
https://linustechtips.com/topic/364033-containerization-vs-virtualization/
Share on other sites

Link to post
Share on other sites

Out of curiosity, what do you guys prefer?

 

I currently have 3 linux (debian and ubuntu) VMs running through KVM on an Ubuntu host. Ive been looking to LXC (containerization) as an alternative in order to save resource shares on my host hardware. I wanted to ask if anybody has any experience with LXC and how is resource use in comparison to KVM (or any other virtualization method for that matter)?

 

While i'm on the topic, how does networking get handled with LXC? Say I wanted one container to run an MySQL server and another container to NGINX or Apache2. I'm assuming I'll loose all advanced networking features as the applications are bound directly to the host interface(s)? Is there any way around that (other than using reverse proxying)?

 

Does anybody here have a working setup that they have posted about wither here on the forum or on their blog/website? I'd like to read up more on LXC before I jump in.

 

I've only worked with the older OpenVZ but presuming LXC is only better, it's very much like running separate systems still as they have their own virtual network interface and IP so you can do any fancy networking you like. Ram/disk usage and other overhead is much lower though due to only 1 kernel running.

2500K @ 4.5GHz | ASRock P67 Extreme 6 | 16GB Ram | GTX 750 Ti | 250gb SSD | 1TB+2TB HDD | 720W CoolerMaster PSU | Essense STX Sound Card | Define R5

Link to post
Share on other sites

I've only worked with the older OpenVZ but presuming LXC is only better, it's very much like running separate systems still as they have their own virtual network interface and IP so you can do any fancy networking you like. Ram/disk usage and other overhead is much lower though due to only 1 kernel running.

 

That's exactly right.

 

I'd honestly go right for KVM to be perfectly honest. OpenVZ is not worth anything--it's a POS.

 

Networking for container'd hosts is basically a virtual network adapter. The host knows it's a virtual adapter (well, it's installed as one, it functions as a normal adapter). You basically route different networks from the node to the containers. You can have your mysql server on a 10.12.11.5 IP and your webserver on 10.12.11.23, and it will all work out, as long as the node has those IP addresses arp'd to it.

--Neil Hanlon

Operations Engineer

Link to post
Share on other sites

You can configure LXC over a bridge interface to get an IP from your router just like KVM. I used LXC for a few months but Docker is so much more convenient. 

 

But doesn't Docker limit you to one application or process per container? That isn't convenient if running a LAMP stack.

▶ Learn from yesterday, live for today, hope for tomorrow. The important thing is not to stop questioning. - Einstein◀

Please remember to mark a thread as solved if your issue has been fixed, it helps other who may stumble across the thread at a later point in time.

Link to post
Share on other sites

There is no limitation of only 1 process per container, that is only a recommendation. Instead of the VM mindset of having everything in 1 container, I would say it's more convenient to have things spread out to allow easy updating of a single component.

Got it.

▶ Learn from yesterday, live for today, hope for tomorrow. The important thing is not to stop questioning. - Einstein◀

Please remember to mark a thread as solved if your issue has been fixed, it helps other who may stumble across the thread at a later point in time.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×