1. LXDLXD
the proper waythe proper way
of runningof running
containerscontainers
Marian HackMan Marinov
Chief System Architect of SiteGround.com
<mm@1h.com>
3. Why containers?Why containers?
➢ Density
➢ KVM has to reserve memory for its guests
➢ Container is a simple process under the same
kernel, so its children can share the whole
machine, and do so in collaboration, because
they use the same memory manager.
4. Why containers?Why containers?
➢ Startup time
➢ KVM 25 sec (can be optimized to around 8)
➢ Container 1.5 sec
➢ KVM 37 guests in 943sec
➢ Container 536 guests in 828sec
Intel Server with 16GB of RAM
5. Why containers?Why containers?
➢ Latency
Physical hardware
Linux Kernel
Host Operating System
Guest OS
Virtual Machine
Linux Kernel
6. Why containers?Why containers?
➢ Latency
Physical hardware
Linux Kernel
Host Operating System
Guest OS
Virtual Machine
Linux Kernel
7. Why containers?Why containers?
➢ Latency
Physical hardware
Linux Kernel
Host Operating System
Guest OS
Virtual Machine
Linux Kernel
Guest OS
Virtual Machine
Linux Kernel
8. Why containers?Why containers?
➢ Latency
Physical hardware
Linux Kernel
Host Operating System
Guest OS
Virtual Machine
Linux Kernelinit
sshd
init
sshd
init
sshd
bridge
9. What is LXD?What is LXD?
➢ A front-end for LXC
➢ Enables easier management of LXC
containers
10. What is LXC?What is LXC?
➢ Linux Containers
➢ The initial project to create what we call
containers today
➢ Userspace interface for the Linux kernel
containment features
11. So why LXD then?So why LXD then?
➢ RESTful API
➢ Ability to work with remote installations
➢ Ability to control multiple LXD nodes
➢ Better command line interface
➢ Easier management
➢ storage
➢ network
➢ limits
➢ migration (including live)
12. InstallationInstallation
➢ Works out of the box on recent Ubuntu
➢ On Debian and CentOS it is a bit annoying
➢ you need go 1.6+
➢ latest lxc(2.0), which you can only build from
source
➢ a lot of other dependencies
➢ it takes about an hour
13. So what can I do with it?So what can I do with it?
14.
15. Marian HackMan Marinov <mm@1h.com>
hackman @ irc.freenode.net
https://github.com/hackman