mysql server optimization with lsi® megaraid® …docs.broadcom.com/.../mysql_wp.pdfmysql database...
TRANSCRIPT
My SQL
MySQL Server Optimization with LSI® MegaRAID® CacheCade™ Pro 2.0 Read and Write Caching Software and Solid State Disk (SSD) Technology
The ability to effectively scale storage performance to meet these new demands by utilizing SSD technology is critical to building a solid solution. This white paper will illustrate the performance benefits of using MegaRAID CacheCade Pro 2.0 software in MySQL server environments. (The MySQL performance benefits discussed in this document may also be applicable to other similar database and transactional applications.)
This document will discuss the following results and benefits of CacheCade Pro 2.0 software:
• ByrunningtheSysBenchTransactionalProcessingworkloadonanactualMySQLdatabaseCacheCade Pro 2.0 software can demonstrate significant performance improvements -- measured in transactions1 per second.
• Dramaticallylowereduserqueryresponsetimesarealsoachieved,deliveringresponses2.5to3.5timesfasterforSASHDDconfigurations,andmorethan7timesbetterresponsetimes for SATA HDD configurations.
• ThearticlealsolooksattheprosandconsofreplacingmoreexpensiveSASHDDswithlower-cost,higher-capacitySATAHDDs.
• HigheruserscalabilityperserverwasalsoachievedwithCacheCadePro2.0software,which was demonstrated by measuring the number of virtual users that could access the databasewithinanacceptableaveragequerylatencylevel.
White Paper
I N T R O D U C T I O N
Today’s workload-intensive business
applications are constrained by
performance limitations of hard disk drives
(HDDs). Solid state drives (SSDs) provide
upto1,000timesmoretransactionsper
second,butatamuchhighercostper
gigabyte(GB).
Amoreeconomicalapproachistomix
bothSSDsandHDDtogether,however
administrators traditionally would
need to configure performance-critical
applications to access SSDs. CacheCade
Pro 2.0 software (figure 1) intelligently and
dynamically handles critical application
acceleration and data performance
requirementswithouttheneedtomonitor
and configure applications to make the
bestuseofSSDs,whileatthesametime
optimizing HDD IO traffic.
CacheCade Pro 2.0 Cache Pool
Mirror
HotData
ColdData
Figure 1CacheCadePro2.0softwareintelligentlycopieshotdatatolowlatency,redundantSSDcache.
Achieving significantly higher transactional databases performance than is possible with hard drive-only configurations by coupling MegaRAID CacheCade Pro 2.0 software with today’s SSD technology.
MySQL Database Performance White Paper 2
CacheCade Pro 2.0 Read/Write Caching Software
CacheCade Pro 2.0 Read/Write Caching Software enables SSDs to be configured as a secondary tierofhighperformancecachetohelpmaximizetransactionalI/Operformance.Thesolutionisdesigned to accelerate the I/O performance of HDD-based arrays while minimizing investments in SSDtechnology.Further,CacheCadesoftwarereducesthesignificantinvestmentinadditionalharddrivesrequiredtoattaincomparableperformancegainsascanbeachievedbyimplementingthesoftware.
CacheCade software relies on its dynamic ability to accelerate accesses to data hot spots. The highest achievable performance benefit depends upon the size and performance of the SSD relative tothelogicalvolumebeingcached,andmorespecificallythetotalsizeofhotdatacomparedtothetotal SSD capacity.
Additionally,thissolutionallowssystembuilderstoinstalljustenoughSSDcapacityforactivedataand apply it to one or more HDD storage volumes.
ByrunningashorttraceofIOactivityontheMySQLdatabase(seeFigure2below),wecandeterminethatthemajorityofthedatabasereadsandwritesarefocusedinspecificrangesoflogicalblockaddresses(LBA).CacheCadesoftware’sintelligentcachingalgorithmsdetectandmaintainfrequentlyaccessedhotreaddataintheSSDs,drasticallyreducingdataaccessresponsetimes.
BecausethemajorityofhotdataaccessesareservicedbytheSSDs,theHDDstoragevolumeperformance is also enhanced as a significant portion of the HDD IO workload is off-loaded to the SSDs.
550
Figure 2XPERF trace of MySQL
database IO activity
Typical database application IO profile shows read and write activity concentrated in specific disk volumeregions–roughly100GB--ofa200GBdatabase.
MySQL Database Performance White Paper 3
MySQL Benchmark and Testing Details
Inordertosimulateatypicalonlinetransactionalprocessingenvironment,anactualMySQLServerdatabase was loaded on to a server and multiple SSD caching configuration capacities were tested to determinetheoptimalconfigurationfora200GBMySQLdatabaseapplication.Table1belowincludesthe system and benchmark details that were used to generate the benchmark results.
Table 1: Test Configuration Details
Server • 1IntelXeonL5520 -4-coreseach,2.27GHz -MySQLServerSysBench• 6GBPC3-8500memory
Operating System • MicrosoftWindows2008-R2,64-bit
BenchmarkSoftware • MySQLServerv5.1.55• IndustryStandardTransactionalBenchmark• SysBenchv0.4.1264-bitforWindows
• UtilizedOLTPAdvancedTransactionalExecution• “innodb”MySQLdatabaseengineused
MegaRAIDSAS9280-8econtroller • Firmware:2.130.03-1332• Windowsdriver:5.1.112• MegaRAIDStorageManager™:8.33-01
• HDDVDsettings-Baseline:WriteBack,DirectIO,AlwaysReadAhead,DriveWriteCacheDisabled,64KBStripSize
• HDDVDsettings-CacheCadeenabled:WriteThrough,DirectIO,NoReadAhead,DriveWriteCacheDisabled,64KBStripSize
SAS HDD Test Configurations
BaselineConfiguration • Sixteen(16)Seagate15KRPMSavvio6Gb/sSASHDDs(ST9146852SS)• RAID10configurationforMySQLdatabaseandlogfiles
CacheCade Pro 2.0 software configurations using Intel X25-E 3G SATA SSDs (SSDSA2SH032G1GN)
• 2driveRAID1,WriteBackenabled• 4driveRAID10,WriteBackenabled• 6driveRAID10,WriteBackenabled• 8driveRAID10WriteBackenabled
SATA HDD Test Configurations
BaselineConfiguration • Eight(8)Seagate7.2KRPMConstellation3Gb/sSATAHDDs(ST9500530NS)• RAID10configurationforMySQLdatabaseandlogfiles
CacheCade Pro 2.0 software configurations using Intel X25-E 3G SATA SSDs (SSDSA2SH032G1GN)
• 2driveRAID1,WriteBackenabled• 4driveRAID10,WriteBackenabled• 6driveRAID10,WriteBackenabled• 8driveRAID10WriteBackenabled
Test Results
Thisbenchmarksimulatesatypicalonlinetransactionprocessing(OLTP)databaseapplication,runningonanactualMySQLServerdatabase.Theworkloadconsistsofamixofbothcomplexandsimplequeries.
A200GBdatabase(889,000,000rows)wasloadedontheseconfigurationsalongwithtwo4000MBlogfiles.Thequeryrequestsvarybetween1to100recordswitharequestmixconsistingof74%readsand26%writes–withanaveragetransactionsizeofaround16KBforreadsandvariedIOrequestsforwrites(typically1KBto2KB).
BecauseCacheCadePro2.0supportsWriteCaching,theSSDsintheCacheCadevolumeweremirrored in RAID 1 or RAID 10 configurations depending on the number of SSDs used. The small capacity(32GB)SSDs,requiremoremirroredSSDstoabsorballhotdataactivity.LargercapacitySSDswillrequirefewerSSDstoachieveoptimalperformance.
IntheSASHDDconfiguration,theCacheCadePro2.0softwareperformanceimprovementgains,measuredintransactionspersecond(TPS)rangefrom1.5xtoover3.5xthatoftheharddriveonlyconfiguration(seeFigure3below),dependingonthecapacityoftheCacheCadePro2.0cachepool.
MySQL Database Performance White Paper 4
HDD Only CCv2 2DR1WB CCv2 4DR10WB CCv2 6DR10WB CCv2 8DR10WB
16DR10SAS
Tran
sact
ions
per
Sec
ond
Impr
ovem
ent
(x ti
mes
)
300
250
200
150
100
50
0
4
3.5
3
2.5
2
1.5
1
0.5
0
SysBench Transactions per Second - MySQL 200GB Database
69.69
104.31
186.65
233.76251.07
Max of Trans/secMax of Improvement
HDD Only CCv2 2DR1WB CCv2 4DR10WB CCv2 6DR10WB CCv2 8DR10WB
16DR10SAS
SysBench Response Times - MySQL 200GB Database
SysB
ench
Ave
rage
Req
uest
Res
pons
e Ti
me
(ms)
Redu
ctio
n (x
tim
es)
160
140
120
100
80
60
40
20
0 0
0.2
0.4
0.6
0.8
1
1.2
Max of RT avg (ms)Max of Reduction
143.22
53.35
95.39
42.2 39.25
SysBench Performance - MySQL 200GB Database
250
200
150
100
50
0
HDD Only CCv2 2DR1WB CCv2 4DR10WB CCv2 6DR10WB CCv2 8DR10WB
8DR10SATA
Perf
orm
ance
(Tra
nsac
tions
per
Sec
ond)
Impr
ovem
ent (
x tim
es)
Max of Trans/secMax of Improvement
8
7
6
5
4
3
2
1
0
31.14
52.95
106.2
214.54225.48
Figure 3SysBenchTPSresultsforMySQL200GBDatabaseonaSASHDDbaseline volume
Figure 5SysBenchTPSresultsforMySQL200GBDatabaseonaSATAHDDbaseline volume
Figure 4 SysBenchresponsetimeresultsforMySQL200GBDatabaseonaSASHDDbaseline volume
Another advantage of CacheCade Pro 2.0 is that response times for transactions are more than 2.5 to 3.5 times faster (See Figure 4) as more ‘hot data’ capacity can run out of the SSD cache.
Additionaltestingwasdonewitheight(8)SATAHDDsreplacingthesixteen(16)SASHDDconfigurations.Seefigures5and6below.
8DR10SATA
350
300
250
200
150
100
50
0 0
0.2
HDD Only CCv2 2DR1WB CCv2 4DR10WB CCv2 6DR10WB CCv2 8DR10WB
0.4
0.6
0.8
1
1.2
Max of RT Avg (ms)Max of Reduction
Aver
age
Requ
est R
espo
nse
Tim
e (m
s)
Redu
ctio
n (x
tim
es)
SysBench Response Times - MySQL 200GB Database
320.66
188.38
93.66
46.12 43.76
Figure6SysBenchresponsetimeresultsforMySQL200GBDatabaseonaSATA HDD baseline volume
Keyobservationsinclude:
• NearequivalentapplicationperformanceisachievedforbothSASand SATA HDD configurations once all hot data is cached in SSDs.
• TheSATAHDDconfigurationsshowedsignificantlyhigherperformanceimprovementwhenthemajorityofthehotdataiscached by the mirrored SSDs.
• Eight(8)SATAHDDsplusfour(4)mirroredSSDsprovidehigherMySQLperformancethan16SASdrives.
• TheSASHDDconfigurationofferedhigherperformancethantheSATA drives for SSD cache misses due to ‘hot data’ capacity that is much larger than the available SSD cache.
• SlowerSATAdriveperformancereducesSSDcachehitperformanceimprovement for smaller number of mirrored SSDs
MySQL Database Performance White Paper 5
300
250
200
150
100
50
0
0 30 60 90 120 150 180 210 240
Time (Minutes)
SysB
ench
Per
form
ance
(Tra
nsac
tions
per
Sec
ond)
16DR10SAS-Max of HDD Only
16DR10SAS-Max of 2DR1WB
16DR10SAS-Max of 4DR10WB
16DR10SAS-Max of 6DR10WB
16DR10SAS-Max 0f 8DR10WB
8DR10SATA-Max of HDD Only
8DR10SATA-Max of 2DR1WB
8DR10SATA-Max of 4DR10WB
8DR10SATA-Max of 6DR10WB
8DR10SATA-Max of 8DR10WB
Figure7SAS and SATA performance
ramp up time comparison
HigheruserscalabilityperserverwasalsoachievedwithCacheCadePro2.0software,whichwasdemonstratedbymeasuringthenumberofusersthatcouldaccessandquerythedatabasewithinan acceptable average latency level. This latency level was defined as 100ms to ensure an acceptable levelofuserqualityofservice(QoS).Asthenumberofthreads–orworkers–wasincreased,theSASHDD-onlyconfigurationresultsquicklyroseabovetheacceptableresponsetimewindow.However,usingCacheCadePro2.0withSSDcache,significantlyheavierworkloadthreadscouldaccessthedatabasewithoutimpactingQoS.Inthisexample,asix(6)SSDRAID1CacheCadePro2.0cachepoolconfiguration could achieve virtually the same response time for twenty workers compared to the one worker for the SAS HDD baseline configuration.
TheSATAHDDconfigurationrequiredmuchlongerrampuptimetooptimalperformancethanthe SAS HDD volumes. This is due to SATA drives taking longer to handle cache misses mentioned above.Asshowninfigure7below,theSATAHDDconfigurationstakeuptofourhourstoramptooptimal,whiletheSASHDDconfigurationstakehalfthattimewithcomparableCacheCadePro2.0cache pool configurations.
250
200
150
100
50
0
1 5 10 15 20
Aver
age
Requ
est R
espo
nse
Tim
e (m
s)
SysBench Thread Count
100 ms MaxResponse Time
HDD Only
2DR1-WB
4DR10-WB
6DR10-WB
8DR10-WB
Figure8Userscalabilitywithacceptableaverage
latencyofrequestresponsetime
For more information and sales office locations, please visit the LSI web sites at: lsi.com lsi.com/channel
LSI,LSI&Designlogo,MegaRAID,andCacheCadearetrademarksorregisteredtrademarksofLSICorporation.Allotherbrandorproductnamesmay be trademarks or registered trademarks of their respective companies.
LSI Corporation reserves the right to make changes to any products and services herein at any time without notice. LSI does not assume any responsibilityorliabilityarisingoutoftheapplicationoruseofanyproductorservicedescribedherein,exceptasexpresslyagreedtoin writingbyLSI;nordoesthepurchase,lease,oruseofaproductorservicefromLSIconveyalicenseunderanypatentrights,copyrights, trademarkrights,oranyotheroftheintellectualpropertyrightsofLSIorofthirdparties.
Copyright ©2011 by LSI Corporation. All rights reserved. September 2011
Further reading
FormoreinformationregardingLSIsolutions,pleasevisit,www.lsi.com/channel
Conclusion
MegaRAIDCacheCadePro2.0softwareisdesignedtodeliverperformancescalability,reducedownership costs and transactional efficiencies critical to meeting the demands of today’s rapidly expandingtransactionalweb2.0ecosystem.
CacheCadesoftwareprovidesacostconsciousoptiontointegrateandrealizeSSDperformance,reducetransactionalcost,andimproveoverallapplicationperformancewithoutextensiveinvestmentin SSDs. This is particularly evident in random read- and write-intensive workloads where adding a few SSDstoanexistingSASHDDarray--orevenreplacingthosewithfewerSATAHDDs--isfeasiblewhilemaintainingexistingHDDcapacity.
CacheCadePro2.0softwareprovidesanadditionaladvantageinthatitdoesnotrequireanymigrationofuserdataoffoftheexistingHDDvolume.
The results of this database simulation clearly show that CacheCade Pro 2.0 software improves overall databaseperformanceinbothtransactionthroughputandqueryresponselatencymeasurements.Italsoillustrateshowadatabaseservercanbeoptimized,usingSSDsandCacheCadePro2.0softwaretosupport significantly heavier workloads than was previously available in DAS server environments.
1. InthecontextofaMySQLdatabaseandtheSysBenchbenchmark,atransactionisasequenceofdatabasecommandsstartingwiththe“Begin”commandandendingwiththe“Commit”command.TheSysBenchAdvancedTransactionaltestmodeisusedtoperformdatabaseoperationsonaMySQL“InnoDB”databasesupportingtransactions.Becauseofthecommandlineoptionsused,eachSysBenchtransactionconsistsofthefollowingdatabasecommands:pointqueries,rangequeries,rangeSUMqueries,rangeORDEREDBYqueries,rangeDISTINCTqueries,UPDATEsonindexcolumn,UPDATEsonnon-indexcolumn,DELETEqueriesandINSERTqueries.EachSysBenchtransactionisconstructedsothatthetotalcontentofthedatabasedoesnotincreaseordecrease,inotherwordsthesameamountofinformationdeletedissubsequentlyinserted.