zfs on the server and the desktop: n+1 ways to better store your data

29
ZFS on the server and the desktop N+1 ways to better store your data Presented at NLUUG 21-11-2013

Upload: matthias-van-der-heide

Post on 28-Nov-2014

641 views

Category:

Technology


0 download

DESCRIPTION

Presented on 21 November 2013 at the NLUUG fall conference in Bunnik, The Netherlands

TRANSCRIPT

Page 1: ZFS on the server and the desktop: N+1 ways to better store your data

ZFS on the server and the desktop

N+1 ways to better store your data

Presented at NLUUG 21-11-2013

Page 2: ZFS on the server and the desktop: N+1 ways to better store your data

About

Matthias van der Heide

Storage Network Engineer

Inprove IT BV an EraStor member

@matthiasvdh on Twitter

Page 3: ZFS on the server and the desktop: N+1 ways to better store your data

Contents

• ZFS Intro

• Features

• N+1 ways

• Why use it in DevOps

• Where to get it

Page 4: ZFS on the server and the desktop: N+1 ways to better store your data

What is ZFS?

• “Zettabyte File System”

• Sun, now Oracle

• Thank Sun for OpenSolaris and releasing ZFS

Page 5: ZFS on the server and the desktop: N+1 ways to better store your data

ZFS Features

• Yes, it is a file system

• It is also volume manager

• Virtually unlimited capacity

• Transactional

• Multiple types of redundancy

• Virtually unlimited snapshots, clones

• Smart caching

• Versioned on-disk format

Page 6: ZFS on the server and the desktop: N+1 ways to better store your data

Copy-on-write

Page 7: ZFS on the server and the desktop: N+1 ways to better store your data

Checksums

NL 08 IN GB 00 00 00 05 55

Page 8: ZFS on the server and the desktop: N+1 ways to better store your data

ARC

• Adaptive Replacement Cache

• Combines MRU and MFU

• Uses ghost lists

• Consumes (a lot of) memory, extend to SSD

Page 9: ZFS on the server and the desktop: N+1 ways to better store your data

ZIL

• ZFS Intent Log

• In memory

• On the pool

• Optionally on a seperate log device (SSD)

Page 10: ZFS on the server and the desktop: N+1 ways to better store your data

Transaction Groups (TXG)

Open • Accept new writes

Quiescing • Wait for I/O to complete

Syncing • Write the data to disk

Page 11: ZFS on the server and the desktop: N+1 ways to better store your data

N+1 ways

• Designing your pool

• Testing your pool

• Tuning the filesystem

• Maintenance

Page 12: ZFS on the server and the desktop: N+1 ways to better store your data

N=1: Designing your pool

• Your performance and redundancy needs determine your pool design

• You can change it, only slightly, afterwards

• Consider a system with 4 HDDs

• Now what do I do?

Page 13: ZFS on the server and the desktop: N+1 ways to better store your data

Redundancy types

• A vdev is the building block of the zpool

• Everything is striped over vdevs

• Options: – Leaf (1)

– Mirror (2..n)

– RAID-Z1 (n+1)

– RAID-Z2 (n+2)

Page 14: ZFS on the server and the desktop: N+1 ways to better store your data

Options

• Stripe over all drives

• Stripe over mirrors

• RAID-Z1

• RAID-Z2

Page 15: ZFS on the server and the desktop: N+1 ways to better store your data

Fun options

• Dual RAID-Z1

• 4-way mirror

• HDD as slog device

Page 16: ZFS on the server and the desktop: N+1 ways to better store your data

N=2: Testing your pool

• Simple: time dd

• Iometer

• Vdbench

• FIO

Page 17: ZFS on the server and the desktop: N+1 ways to better store your data

N=3: Tuning your filesystem

• Block size

• Log bias

• Access time

• Sync on/off

• Caching on/off

Page 18: ZFS on the server and the desktop: N+1 ways to better store your data

N=4: Maintenance

• ZFS will tell you when stuff is broken

• Check data on all reads

• Regular scrubs

Page 19: ZFS on the server and the desktop: N+1 ways to better store your data

Scrubs

• Scans the pool for data integrity

• Checks checksums

• Restores data if needed

• Can take a while on large pools

Page 20: ZFS on the server and the desktop: N+1 ways to better store your data

Scrub

Page 21: ZFS on the server and the desktop: N+1 ways to better store your data

Scrub time

0,00

10,00

20,00

30,00

40,00

50,00

60,00

70,00

80,00

90,00

100,00

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71

Estimate accuracy

Estimate accuracy

Page 22: ZFS on the server and the desktop: N+1 ways to better store your data

Resilvers

• When replacing a device

• When adding a device back after removal

Page 23: ZFS on the server and the desktop: N+1 ways to better store your data

Simple detach/attach

Page 24: ZFS on the server and the desktop: N+1 ways to better store your data

After being offline

Page 25: ZFS on the server and the desktop: N+1 ways to better store your data

New device

Page 26: ZFS on the server and the desktop: N+1 ways to better store your data

Future work on ZFS

• Feature flags enables development of features seperately

• Persistent L2ARC

• Larger block support

• Dedupe tables on SSD

Page 27: ZFS on the server and the desktop: N+1 ways to better store your data

Why use it in DevOps

• ZFS performs

• ZFS scales

– From your laptop to your workstation to your cloud

• ZFS replicates

– Using zfs send/receive you can deploy copies of your VMs to other hosts

– Keep simple backups of your repos and machines

• Use snapshots to boot into new versions of your operating system

Page 28: ZFS on the server and the desktop: N+1 ways to better store your data

Where to get it?

• FreeBSD

• Mac

• ZFS on Linux

• Illumos (EraStor OS)

• NexentaStor (based on OpenSolaris/Illumos)

• OpenZFS - http://open-zfs.org

Page 29: ZFS on the server and the desktop: N+1 ways to better store your data

Links

• Open ZFS Project http://open-zfs.org

• ARC Paper http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.13.5210

• NOSIG http://www.nosig.nl/

• Erastor http://www.erastor.eu