which hypervisor is best? my sql on ceph

30
Which Hypervisor is Best? MySQL on Ceph 3:30pm – 4:20pm Room 203

Upload: redhatstorage

Post on 07-Apr-2017

882 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Which Hypervisor Is Best? My SQL on Ceph

Which Hypervisor is Best?MySQL on Ceph

3:30pm – 4:20pmRoom 203

Page 2: Which Hypervisor Is Best? My SQL on Ceph

WHOIS

Kyle BaderStorage Solution ArchitecturesRed Hat

Yves TrudeauPrincipal ArchitectPercona

Page 3: Which Hypervisor Is Best? My SQL on Ceph

AGENDA

• Ceph Architecture Elevator Pitch• Tuning Ceph Block (RBD)• Tuning QEMU Block Virtualization• Benchmarks

Page 4: Which Hypervisor Is Best? My SQL on Ceph

Ceph Architecture

Page 5: Which Hypervisor Is Best? My SQL on Ceph

ARCHITECTURAL COMPONENTS

RGWA web services

gateway for object storage, compatible

with S3 and Swift

LIBRADOSA library allowing apps to directly access RADOS (C, C++, Java, Python, Ruby,

PHP)RADOS

A software-based, reliable, autonomous, distributed object store comprised ofself-healing, self-managing, intelligent storage nodes and lightweight monitors

RBDA reliable, fully-distributed block device with cloud

platform integration

CEPHFSA distributed file

system with POSIX semantics and

scale-out metadata

APP HOST/VM CLIENT

Page 6: Which Hypervisor Is Best? My SQL on Ceph

ARCHITECTURAL COMPONENTS

RGWA web services

gateway for object storage, compatible

with S3 and Swift

LIBRADOSA library allowing apps to directly access RADOS (C, C++, Java, Python, Ruby,

PHP)RADOS

A software-based, reliable, autonomous, distributed object store comprised ofself-healing, self-managing, intelligent storage nodes and lightweight monitors

RBDA reliable, fully-distributed block device with cloud

platform integration

CEPHFSA distributed file

system with POSIX semantics and

scale-out metadata

APP HOST/VM CLIENT

Page 7: Which Hypervisor Is Best? My SQL on Ceph

Linux Containers vs

Virtual Machines

Page 8: Which Hypervisor Is Best? My SQL on Ceph

KVM/QEMU RBD BACKEND

M M

RADOS CLUSTER

VM

HYPERVISORLIBRBD

Page 9: Which Hypervisor Is Best? My SQL on Ceph

PERCONA ON KRBD

M M

RADOS CLUSTER

CONTAINER HOSTKRBD

Page 10: Which Hypervisor Is Best? My SQL on Ceph

TUNING CEPH BLOCK

Page 11: Which Hypervisor Is Best? My SQL on Ceph

TUNING CEPH BLOCK

• Format• Order• Fancy Striping• TCP_NO_DELAY

Page 12: Which Hypervisor Is Best? My SQL on Ceph

RBD FORMAT

• Format 1• Deprecated• Supported by all versions of Ceph• No reason to use it in greenfield environment

• Format 2• New, default, format• Support snapshot and clone

Page 13: Which Hypervisor Is Best? My SQL on Ceph

RBD ODER

• The chunk / striping boundary for block device• Default is 4MB -> 22• 4MB = 222

• Used default during our testing

Page 14: Which Hypervisor Is Best? My SQL on Ceph

RBD: Fancy Striping

• Only available to QEMU / librbd• Finer striping for parallelization of small writes across

order• Helps with some HDD workloads• Used default during our testing

Page 15: Which Hypervisor Is Best? My SQL on Ceph

TCP_NO_DELAY

• Disables Nagel congestion control algorithm• Important for latency sensitive workloads• Good for maximizing IOPS -> MySQL• Default in QEMU• Default in KRBD• Added in mainline 4.2• Backported to RHEL 7.2 3.10-236+

Page 16: Which Hypervisor Is Best? My SQL on Ceph

TUNING QEMUBLOCK VIRTUALIZATION

Page 17: Which Hypervisor Is Best? My SQL on Ceph

TUNING QEMU BLOCK

• Paravirtual Devices• AIO Mode• Caching• x-data-plane• num_queues

Page 18: Which Hypervisor Is Best? My SQL on Ceph

QEMU: PARAVIRTUAL DEVICES

• Virtio-blk• Virtio-scsi

Page 19: Which Hypervisor Is Best? My SQL on Ceph

QEMU: AIO MODE

• Threads• Software implementation of aio using thread pool

• Native• User Kernel AIO• Way to go in the future

Page 20: Which Hypervisor Is Best? My SQL on Ceph

QEMU: CACHING

  Writeback None Writethrough Directsync

Uses Host Page Cache Yes No Yes No

Guest Disk WCE Enabled Enabled Disabled Disabled

rbd_cache True False True False

rbd_max_dirty 25165824 0 0 0

Page 21: Which Hypervisor Is Best? My SQL on Ceph

QEMU: Timers

• Block storage benchmark too – fio• Very frequent access to CPU timing registers• Accesses need to be emulated• Can block main QEMU event loop with concurrent high

IO load

Page 22: Which Hypervisor Is Best? My SQL on Ceph

QEMU: Timers

• Block storage benchmark too – fio• Very frequent access to CPU timing registers• Accesses need to be emulated• Can block main QEMU event loop with concurrent high

IO load

Page 23: Which Hypervisor Is Best? My SQL on Ceph

BENCHMARKS

Page 24: Which Hypervisor Is Best? My SQL on Ceph

BENCHMARKS• Sysbench OLTP, 32 tables of each 28M rows, ~200GB• MySQL config: 50GB buffer pool, 8MB log file size, ACID• Filesystem: XFS with noatime, nodiratime, nobarrier• Data reloaded before each test• 100% reads: --oltp-point-select=100• 100% writes: --oltp-index-updates=100• 70%/30% reads/writes: --oltp-index-updates=28 --oltp-point-select=70

--rand-type=uniform• 20 minute run time per test, iterations averaged• 64 threads, 8 cores

Page 25: Which Hypervisor Is Best? My SQL on Ceph

BASIC QEMU PERFORMANCE

qemu tcg qemu-kvm-default io=threads cache=none io=native cache=none0

5000

10000

15000

20000

25000

30000

35000

Reads Writes R/W 70/30

IOPS

Page 26: Which Hypervisor Is Best? My SQL on Ceph

THREAD CACHING MODES

io=threads cache=none io=threads cache=writethrough io=threads cache=writeback0

5000

10000

15000

20000

25000

30000

Reads Writes R/W 70/30

IOPS

Page 27: Which Hypervisor Is Best? My SQL on Ceph

DEDICATED DISPATCH THREADS

io=na

tive ca

che=no

ne

io=na

tive ca

che=dir

ectsyn

c

io=na

tive ca

che=dir

ectsyn

c_x00

0d_io

threa

d=1

io=na

tive ca

che=dir

ectsyn

c_x00

0d_io

threa

d=2

0

5000

10000

15000

20000

25000

30000

35000

Reads Writes R/W 70/30

IOPS

Page 28: Which Hypervisor Is Best? My SQL on Ceph

DATA PLANE AND VIRTIO-SCSI QUEUES

x-data-plane virtio-scsi, num-queues=4 virtio-scsi, num-queues=2, vectors=3

virtio-scsi, num-queues=4, vectors=5

0

5000

10000

15000

20000

25000

30000

35000

40000

Reads Writes R/W 70/30

IOPS

Page 29: Which Hypervisor Is Best? My SQL on Ceph

CONTAINERS AND METAL

Metal (t

askset

-c 10

-17)

lxc (c

group

cpu 1

0-17)

io=thr

eads

cache

=none

io=na

tive ca

che=no

ne

virtio

-scsi,

num-qu

eues=

2, vec

tors=

30

10000

20000

30000

40000

50000

60000

Reads Writes R/W 70/30

IOPS

Page 30: Which Hypervisor Is Best? My SQL on Ceph

THANK YOU