Linux Cgroups

Linux Cgroups

Student Presentation Linux Containers (LXC) Lightweight virtualisation alternative to VMs Elvin Sindrilaru CERN Thematic CERN School of Computing 2014 Student presentation / Linux containers (LXC) Outline . Linux namespaces and control groups (cgroups) . Linux containers (LXC) . Docker – LXC high level wrapper . Containers demo 2 Elvin Sindrilaru– CERN Student presentation / Linux containers (LXC) Linux namespaces . The purpose of a namespace is to wrap a particular global system resource in an abstraction that makes it appear to the process within the namespace that they have their own isolated instance of the global resource. Currently 6 namespaces implemented in the Linux Kernel: . Mount . UTS (Unix Time-sharing System) . IPC (Inter-process communication) . PID . Network . User namespace 3 Elvin Sindrilaru– CERN Student presentation / Linux containers (LXC) Linux cgroups . Cgroups allow allocating resources to user-defined groups of processes running on the system . Cgroup subsystems (resources controllers) = kernel modules aware of cgroups which allocate varying levels of system resources to cgroups . Everything is exposed through a virtual filesystem: /cgroups, /sys/fs/cgroup … - mountpoint may vary . Currently up to 10 subsystems: . blkio – set limits on input/output access to/from block devices such as physical drives . cpuset – assign individual CPUs to tasks in a cgroup . memory – limits on memory used by tasks in a cgroup 4 Elvin Sindrilaru– CERN Student presentation / Linux containers (LXC) Linux containers - LXC . Containers . tool for lightweight virtualization . provides a group of processes the illusion that they are the only ones running on the system . Advantages in comparison to traditional VM: . Fast to deploy - seconds . Small memory footprint - MBs . Complete isolation without a hypervisor Namespaces + Cgroups => Linux containers 5 Elvin Sindrilaru– CERN Student presentation / Linux containers (LXC) Containers on a host machine Linux kernel >= 3.8 6 Elvin Sindrilaru– CERN Student presentation / Linux containers (LXC) Docker– LXC wrapper 7 Elvin Sindrilaru– CERN Student presentation / Linux containers (LXC) Docker – Layers . Union File System – union of read-write layer and all read- only layers . Docker Image - read-only layer, basically the root filesystem where lxc containers run in . All modifications go into the RW layer 8 Elvin Sindrilaru– CERN Student presentation / Linux containers (LXC) Docker Containers . Container . Read-write layer . Information about Parent Image (RO layers) . Unique id + network configuration + resource limits . Exited container preserves the file system state but not the memory state . Inside it looks like a VM, outside looks like a normal process . Containers have state: running / exited . Containers can be promoted to images: “docker commit” Takes a snapshot of the whole filesystem (RW+RO) 9 Elvin Sindrilaru– CERN Student presentation / Linux containers (LXC) Containers Demo 10 Elvin Sindrilaru– CERN .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    10 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us