0

I would like to create a Linux server but I'm stuck on one question:

  • How to know when I should use Docker or Lxc for a given application instead of installing it natively ?

For example, on my server (maybe CentOS minimal or Arch Linux or Alpine Linux depending on the answers to this question), I would like to install:

  • Python 3
  • FTP server
  • Mono
  • PHP
  • NGiNX
  • Docker (or Lxc)
  • many others app

What about the performances:

  • Will my server be faster with or without containers ?
  • Will it be more secure (CVE vulnerabilities)
  • Will it be easier to maintain (software updates) ?

1 Answer 1

0

Bare metal (what I think you mean by natively) is usually more performant than any kind of virtualization/containerization simply due to the fact that there is less system overhead between hardware, kernel and OS.

A container is going to give you the benefit of managing multiple instances of an OS (snapshots, migration, image dumps/backups, resource prioritization, etc.) without incurring a heavy performance penalty. Containerization security does have some disadvantages over full virtualization however.

A full VM would be a better choice when performance is less of a concern since fully virtualization usually involves emulating various hardware devices. Each virtual instance is a complete operating system (with exception of hardware pass-through) processes, kernel, libraries and applications running within it. It's considered to be much harder for an attacker to break out of a fully virtualized host over a container but this risk/attack surface is going to vary by vendor.

If you're not doing extremely heavy I/O or CPU utilization, you probably won't see a big performance hit for either containers or full VMs. As an example, containerization would be a better choice for something like a software testing or compilation node where you want the best performance you can get to lessen development lead times, however you still want to be able to snapshot or roll-back installations easily (something you cannot do easily with bare-metal).

You will probably have to experiment with you software stack a bit but with the list you've give, I would go full virtualization to get all the benefits of security and VM management.

1
  • Your answer seems to be the right on, regarding my needs and I'll keep using bare-metal instead of trying to container because I'll use a physical server and I can't waste resources with virtualization.
    – locobastos
    Commented Feb 25, 2020 at 21:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .