+ All Categories
Home > Software > PFcache - LinuxCon 2015

PFcache - LinuxCon 2015

Date post: 16-Apr-2017
Category:
Upload: openvz
View: 263 times
Download: 0 times
Share this document with a friend
23
Denser containers with PFCache Denser containers with PFCache Pavel Emelyanov ContainerCon, Seattle, 2015
Transcript
Page 1: PFcache - LinuxCon 2015

Denser containers with PFCacheDenser containers with PFCache

Pavel Emelyanov

ContainerCon, Seattle, 2015

Page 2: PFcache - LinuxCon 2015

AgendaAgenda

• How to store container files

• Why shared template matters

• What can be deduplicated and what should be

• PFCache

• Q&A

2

Page 3: PFcache - LinuxCon 2015

How to store container filesHow to store container files

3

Filesystem

Containerprocesses

Page 4: PFcache - LinuxCon 2015

How to store container filesHow to store container files

4

Filesystem

Containerprocesses

Block device

NetworkHostFilesystem

Hostblock device

Hardware

Page 5: PFcache - LinuxCon 2015

How to store container files (1)How to store container files (1)

5

Filesystem

Containerprocesses

Block device

NetworkHostFilesystem

Hostblock device

Hardware

Chroot()Union FS

Page 6: PFcache - LinuxCon 2015

How to store container files (2)How to store container files (2)

6

Filesystem

Containerprocesses

Block device

NetworkHostFilesystem

Hostblock device

Hardware

Loop deviceZFS ZVolBTRFS subvolumePLoop

Page 7: PFcache - LinuxCon 2015

What's PLoopWhat's PLoop

• Loop device plus

– AIO for better performance

– Snapshots

– QCOW2-like format for thin provisioning

– Thin provisionong itself

• Upstreaming work in progress

7

Page 8: PFcache - LinuxCon 2015

How to store container files (3)How to store container files (3)

8

Filesystem

Containerprocesses

Block device

NetworkHostFilesystem

Hostblock device

Hardware

LVMDM-thin

Page 9: PFcache - LinuxCon 2015

How to store container files (4)How to store container files (4)

9

Filesystem

Containerprocesses

Block device

NetworkHostFilesystem

Hostblock device

Hardware

NBDCeph RBDiSCSI

Page 10: PFcache - LinuxCon 2015

How to store container files (5)How to store container files (5)

10

Filesystem

Containerprocesses

Block device

NetworkHostFilesystem

Hostblock device

Hardware

NFSGFS2OCFSCeph

Page 11: PFcache - LinuxCon 2015

Containers vs TemplatesContainers vs Templates

• Containers ...

– are massively cloned from pre-created “templates”

– do not have direct access to the underlying (block) storage

• Identical data can be effectively deduplicated

– Higher density

– Lower IO and/or memory consumption

11

Page 12: PFcache - LinuxCon 2015

Who can do shared templatesWho can do shared templates

12

Storage OpenVZ Docker LXC

Union FSs + + +

Btrfs +

DM-thin +

PLoop +

Ceph

ZFS +

Page 13: PFcache - LinuxCon 2015

What can be de-duplicatedWhat can be de-duplicated

13

Filesystem

Containerprocesses

Block device Network

Page 14: PFcache - LinuxCon 2015

What can be de-duplicatedWhat can be de-duplicated

14

Filesystem

Containerprocesses

Block device Network

Page cacheCached pages

Page 15: PFcache - LinuxCon 2015

What can be de-duplicatedWhat can be de-duplicated

15

Filesystem

Containerprocesses

Block device Network

Page cacheCached pages

IO flow

Page 16: PFcache - LinuxCon 2015

What is deduplicatedWhat is deduplicated

16

Storage Memory IO

Union FSs + +

Btrfs +/-

DM-thin

PLoop + +

Ceph

ZFS

Page 17: PFcache - LinuxCon 2015

Additional OpenVZ constraintsAdditional OpenVZ constraints

• Containers disks are independent image files

– Can be easily copied across nodes

– No single (shared) point of failure

• Deduplicated data is volatile

– “Templates” can be lost (e.g. while migrating)

– Too big pool with shared data can be easily shrunk

17

Page 18: PFcache - LinuxCon 2015

Virtuozzo IO stackVirtuozzo IO stack

18

Ext4

Containerprocesses

PLoop device

Image file

Page 19: PFcache - LinuxCon 2015

PF-CachePF-Cache

19

Ext4

PLoop device

Cache area

Cache link (xattr)Ext4

Containerprocesses

PLoop device

Image file Image file

Page 20: PFcache - LinuxCon 2015

Cache and cache link behaviorCache and cache link behavior

• Cache area

– target file name is sha1 sum of the contents

– files are created by user-space daemon

– cache size is limited by ploop

• Cache link

– created automatically upon file creation

– dropped when file is opened for writing

– Is kept during metadata update (chown/chmod)

20

Page 21: PFcache - LinuxCon 2015

Density resultsDensity results

21

Page 22: PFcache - LinuxCon 2015

Future workFuture work

• PLoop is available in OpenVZ & Virtuozzo

– Upstream WIP

• IO deduplication in the upstream

– Issue raied at 2013'th LSFMM

– DM-thin/btrfs IO dedup for containers

– KSM++ for VM-s

22


Recommended