Container-based virtualization Process-level Extensively used in - - PowerPoint PPT Presentation

container based virtualization
SMART_READER_LITE
LIVE PREVIEW

Container-based virtualization Process-level Extensively used in - - PowerPoint PPT Presentation

C NTR Lightweight OS Containers Jrg Thalheim, Pramod Bhatotia Pedro Fonseca Baris Kasikci USENIX ATC 2018 Container-based virtualization Process-level Extensively used in Lightweight virtualization production isolation Namespaces


slide-1
SLIDE 1

CNTR

Lightweight OS Containers

Jörg Thalheim, Pramod Bhatotia Baris Kasikci Pedro Fonseca

USENIX ATC 2018

slide-2
SLIDE 2

Container-based virtualization

Lightweight isolation Namespaces Process-level virtualization Cgroups Extensively used in production

2

slide-3
SLIDE 3

Why lightweight containers are important?

  • Fast deployment
  • Low resource usage
  • Low build times

3

slide-4
SLIDE 4

Containers are NOT lightweight anymore!

Only 33% data was accessed by the applications! Lower is better

Limitations: Inefficient development and deployment of containers

4

Case study: Top 50 Docker Hub container images

slide-5
SLIDE 5

Why containers are becoming heavyweight?

Build description: e.g. Dockerfile Application (MySQL) Additional tools (Coreutils, ...) Container images are large due to additional tools! Host Container Container image

5

slide-6
SLIDE 6

Additional tools

  • Why are they important?

○ Debugging, inspection, monitoring, management, etc.

6

Additional tools are NOT used in the common use case

  • What are these additional tools?

○ Debuggers, editors, coreutils, shell, etc.

slide-7
SLIDE 7

Cntr: Split container images

Slim image Fat image

Slim container Runs the application Fat container Serves tools to the user Original image CNTR Provides access Common use case Deployed on demand

7

slide-8
SLIDE 8

Design

slide-9
SLIDE 9

Design goals

  • Generality

○ Support a wide range of workflows (debugging, inspection, etc.)

  • Efficiency

○ No performance overhead on the application

  • Transparency

○ No modifications to the OS, container engine, and application

9

slide-10
SLIDE 10

Overview

Nested namespace App (MySQL) CntrFS server Slim container Fat container User Access tools via FUSE Access the application Tools

(Gdb, coreutils...)

Access tools

10

slide-11
SLIDE 11

Nested namespace

  • Implemented on top of existing OS features

○ Namespaces ○ FUSE

/ var usr lib cntr usr bin mysql bin gdb

“Slim” image “Fat” image

  • Nested namespace

filesystem view

11

slide-12
SLIDE 12

“Fat” container Nested namespace

POSIX filesystem API System call

Kernel space

Process

User space

CntrFS

CntrFS server Request VFS FUSE

Process and CntrFS server can run in different namespaces (container)

12

slide-13
SLIDE 13
  • Easy to use

Implementation

  • Lightweight deployment

○ Single 1.2 MB static binary root@fat-container $ cntr attach slim-container root@slim-container $

  • Supports all popular containers

○ Docker, LXC, LXD, Systemd-nspawn, rkt, etc.

13

slide-14
SLIDE 14

Evaluation

slide-15
SLIDE 15

Evaluation

  • Questions:

1. Is the implementation complete? 2. What are the performance overheads? 3. How effective is the approach in reducing container image sizes?

  • Experimental testbed:

○ M4.xlarge VM on EC2 ○ 100 GB device of type GP2 (SSD-backed network storage) ○ Base filesystem: Ext4

15

slide-16
SLIDE 16

○ Unsupported tests are minor Linux-specific implementation details ○ 3 of 4 unsupported tests also don’t work on overlayfs (default on Docker)

#1: Completeness

  • Benchmark: Xfstests regression test suite

Cntr can already be used in production Tests Supported tests 94 90 (95.74%)

16

slide-17
SLIDE 17

#2 (a): Overheads for the “slim” container

17

0%

For the common use case

  • f accessing the slim container
slide-18
SLIDE 18

#2 (b): Overheads for the “fat” container

Cntr incurs reasonable overhead for management tasks Lower is better

1.5x

18

Phoronix test suite

slide-19
SLIDE 19

#3: Effectiveness

Average reduction is 66% of the container size Containers with static Go binaries Majority of containers contains unnecessary data T

  • p

5 c

  • n

t a i n e r s

  • n

D

  • c

k e r H u b

19

slide-20
SLIDE 20

Demo!

slide-21
SLIDE 21

Demo setup

21

Host: NixOS “Slim” container: Busybox Access Via CNTR

$ sudo docker run --name mycontainer busybox $ sudo cntr attach mycontainer

slide-22
SLIDE 22

Summary

  • Containers are NOT lightweight in practice

○ Limitation: Inefficient development and deployment of containers

  • CNTR: Lightweight OS Containers

○ Splits the container image into fat and slim parts ○ Leverages FUSE to expose additional tools in a nested namespace

Generic + Transparent + Efficient Try it out!

https://github.com/Mic92/cntr

22