mysql and ssd - percona · pdf filemysql and ssd vadim tkachenko percona inc, co-founder, cto ...
TRANSCRIPT
MySQL and SSD
Vadim TkachenkoPercona Inc, co-founder, CTO
www.percona.comwww.SSDPerformanceBlog.com
World is spinning
MySQL and SSD
Physical limits
MySQL and SSD
Rotate faster
MySQL and SSD
millisecondsAccess time
MySQL and SSD
More spindles
MySQL and SSD
Still milliseconds
MySQL and SSD
Access time
MySQL and SSD
MySQL and SSD
Data fits into memory
Data
exceeds
memory
MySQL and SSD
Flash Access time
MySQL and SSD
MySQL throughput with Flash
MySQL and SSD
5x+Times difference
Flash
MySQL and SSD
MySQL and SSD
Erase size
MySQL and SSD
Write once
MySQL and SSD
MySQL and SSD
No rewrites
MySQL and SSD
MySQL and SSD
Garbage collector
MySQL and SSD
Write amplificationFlash writes more than application
MySQL and SSD
Software matters
MySQL and SSD
Hardware is less important
MySQL and SSD
MySQL and SSD
Firmware
+
execution
Flash quality is defined by software
MySQL and SSD
Flash types
MySQL and SSD
Single Level Cell – 1bit
MySQL and SSD
Multi Level Cell – 2 bit
MySQL and SSD
Multi Level Cell – 3 bit
MySQL and SSD
SLC vs MLC
MySQL and SSD
Erase cycles
MySQL and SSD
• SLC 100.000 cycles
• MLC 10.000 cycles
• 25nm MLC 5.000 cycles
SLC
MySQL and SSD
MLC
MySQL and SSD
Space provisioning – Virident FlashMax 1400
MySQL and SSD
User space
1.4TB
Internal Space
0.6TB
SATA vs PCI Express
MySQL and SSD
SATA SSD
MySQL and SSD
My benchmarks story2 Intel 320 SSD cards
MySQL and SSD
How do I install it?
MySQL and SSD
I need
MySQL and SSD
Initial setup
MySQL and SSD
Polished setup - AccuSTOR AS108X
MySQL and SSD
RAID controllers
MySQL and SSD
Last component - cable
MySQL and SSD
PCIe is different
MySQL and SSD
PCIe
MySQL and SSD
Just plug into a PCIe slotBut SATA is hot-swap
MySQL and SSD
Benchmarks lie
MySQL and SSD
Benchmark challenge: internal state
MySQL and SSD
Benchmark challenge: capacity
MySQL and SSD
Unrepeatable results
MySQL and SSD
Benchmark challenge: filesystems
MySQL and SSD
Benchmark challenge: filesystems
MySQL and SSD
Xfs already fixed bug in source code4x improvement
MySQL and SSD
Benchmark challenge: filesystems
MySQL and SSD
Ext4 – sync – random write
MySQL and SSD
xfs – sync – random write
MySQL and SSD
Ext4 vs xfs – async
MySQL and SSD
135
98
0
20
40
60
80
100
120
140
160
ext4 xfs
MiB
/ s
ec
async writes
To add to confusion: in MySQL
MySQL and SSD
Ext4 vs xfs – your choice
MySQL and SSD
Comparing apples
MySQL and SSD
Flash vendors~50 on market
MySQL and SSD
Random 16KiB reads
MySQL and SSD
50
222
417
195
1300
0
200
400
600
800
1000
1200
1400
MiB
/ s
ec
8 HDDSTEC4 STECIntelVirident
Random 16KiB writes
MySQL and SSD
35
135
223
92
520
0
100
200
300
400
500
600
MiB
/ s
ec
8 HDDSTEC4 STECIntelVirident
Price
MySQL and SSD
24001500
6000
270
18000
02000400060008000
100001200014000160001800020000
Pric
e, $
8 HDDSTEC4 STECIntelVirident
PCIe vs SATAWhich one to choose?
MySQL and SSD
PCIe for absolute performanceI use it because I have free samples
MySQL and SSD
SATA for performance per $I would use it if I had to buy…
MySQL and SSD
When should I use flash?
MySQL and SSD
Very good for random readsBoth SLC and MLC
MySQL and SSD
Random WritesMaybe challenge for MLC
MySQL and SSD
SLC lifetime
MySQL and SSD
MLC lifetime
MySQL and SSD
Write amplification
MySQL and SSD
Experiment – tpcc-mysql
MySQL and SSD
Flash for MySQL
MySQL and SSD
When Flash helps
MySQL and SSD
Most important decision
MySQL and SSD
MySQL and SSD
You need
MySQL and SSD
Choices
MySQL and SSD
Benchmarks again
MySQL and SSD
MySQL and SSD
STEC SSD vs HDD: 8x gain
MySQL and SSD
750
90
0
100
200
300
400
500
600
700
800
SSD HDD
tps
STEC innodb_flush_log_at_trx_commit
MySQL and SSD
750
490
0
100
200
300
400
500
600
700
800
trx_commit=2 trx_commit=1
tps
MySQL IO workloads
MySQL and SSD
innodb_flush_log_at_trx_commit=1
MySQL and SSD
STEC: InnoDB log location
MySQL and SSD
740
490
0
100
200
300
400
500
600
700
800
logs on RAID with cache logs on SSD
tps
STEC – RAID card
MySQL and SSD
750810
0100200300400500600700800900
LSI 9211 (no cache) LSI 9260 (with cache)
tps
Log size matters
MySQL and SSD
Big log file 8GB (Percona Server)
MySQL and SSD
Flushing algorithm is important
MySQL and SSD
Innodb_adaptive_checkpoint=keep_average(Percona Server)
MySQL and SSD
DoubleWrite area is important
MySQL and SSD
DoubleWrite is a protection
MySQL and SSD
DoubleWrite is rewriting the same area
MySQL and SSD
Rewrites of the same area
MySQL and SSD
Consider moving doublewrite • Innodb_doublewrite_file =• Percona Server
• ibdata1• For general MySQL
MySQL and SSD
Fusion-io to support atomic writes1.5x performance improvement
MySQL and SSD
Misc
MySQL and SSD
Misc filesystem
MySQL and SSD
Is Flash expensive?
MySQL and SSD
Consolidation
MySQL and SSD
Power savings
MySQL and SSD
New Relic
MySQL and SSD
Dell PowerEdge R610
Dell PowerVault MD1220
MySQL and SSD
Perc H800RAID511 Intel 320 SSD 600GB
MySQL and SSD
6xtimes difference
Scale Up, not Scale Out
MySQL and SSD
“Flash made everything faster, but more confusing”
MySQL and SSD
Pictures credits• http://
www.sunrainet.com/hdd-vs-ssd-speed-test-video-windows-7-boot-up.html• http://blog.familytreemagazine.com/insider/content/binary/datacenter-2.jpg
MySQL and SSD
Thank you!
MySQL and SSD