![Page 1: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/1.jpg)
StaringintotheAbyss:AnEvaluationofConcurrencyControlwithOneThousandCores
XiangyaoYu1GeorgeBezerra1 AndrewPavlo2
Srinivas Devadas1 MichaelStonebraker1
1CSAIL,MassachusettsInstituteofTechnology
2Dept.ofComputerScienceCarnegieMellonUniversity
PublishedinVLDB2014
Presenter:VaibhavJain
1
![Page 2: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/2.jpg)
Motivation(1)
ØTheeraofsingle-coreCPUspeed-upisover.
ØNumberofcoresonachipisincreasingexponentially§ Increasecomputationpowerbythreadlevelparallelism
§ 1000-corechipsarenear…
XeonPhi(upto61cores) Tilera (upto100cores)
2
![Page 3: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/3.jpg)
Motivation(2)
ØIstheDBMSreadytobescaled?§ MostDBMSsstillfocusonsingle-threadedperformance
§ Existingworksonmulti-coresfocusonsmallcorecount
3
![Page 4: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/4.jpg)
Objective
• Toevaluatetransactionprocessingat1000cores.• Focusononescalabilitychallenge:Concurrencycontrol.• Discussthebottlenecksandimprovementsneeded.
4
![Page 5: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/5.jpg)
Implementation
• ConcurrencyControlSchemes• DBMSTestBed
5
![Page 6: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/6.jpg)
ConcurrencyControlSchemes
CC Scheme Description
DL_DETECT 2PLwithdeadlockdetection
NO_WAIT 2PLwithnon-waitingdeadlockprevention
WAIT_DIE 2PLwithwait-and-diedeadlockprevention
TIMESTAMP Basic T/Oalgorithm
MVCC Multi-version T/O
OCC Optimisticconcurrencycontrol
HSTORE T/Owithpartition-levellocking
Two–PhaseLocking(2PL)
TimestampOrdering(T/O)
Partitioning
6
![Page 7: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/7.jpg)
Two-PhaseLocking(1)
7
![Page 8: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/8.jpg)
Two-PhaseLocking(2)
8
ØLockconflict§ DL_DETECT:alwayswait.§ NO_WAIT:alwaysabort.§ WAIT_DIE:waitifolder,otherwiseabort
ØExamplesystems§ Ingres,Informix,IBMDB2,MSSQLServer,MySQL(InnoDB)
deadlockdetection
deadlockprevention
![Page 9: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/9.jpg)
ConcurrencyControlSchemes
CC Scheme Description
DL_DETECT 2PLwithdeadlockdetection
NO_WAIT 2PLwithnon-waitingdeadlockprevention
WAIT_DIE 2PLwithwait-and-diedeadlockprevention
TIMESTAMP Basic T/Oalgorithm
MVCC Multi-version T/O
OCC Optimisticconcurrencycontrol
HSTORE T/Owithpartition-levellocking
Two–PhaseLocking(2PL)
TimestampOrdering(T/O)
Partitioning
9
![Page 10: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/10.jpg)
TimestampOrdering(T/O)(1)
Eachtransactionhasauniquetimestampindicatingtheserialorder.1.TIMESTAMP(BasicTimestampOrdering)• R/Wrequestrejectediftx timestamp <timestampoflastwrite.
2.MVCC(Multi-VersionConcurrencyControl)• Everywriteopcreatesanewtimestampedversion• Forreadop,DBMSdecideswhichversionitaccesses.
10
![Page 11: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/11.jpg)
TimestampOrdering(T/O)(2)
3.OCC(Optimistic Concurrency Control)• Privateworkspaceofeachtransaction.• Atcommittime,ifanyoverlap,tx isabortedandrestarted.• Advantage:shortcontentionperiod.
ExamplesystemsOracle,Postgres,MySQL(InnoDB),SAPHANA,MemSQL,MSHekaton
11
![Page 12: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/12.jpg)
ConcurrencyControlSchemes
CC Scheme Description
DL_DETECT 2PLwithdeadlockdetection
NO_WAIT 2PLwithnon-waitingdeadlockprevention
WAIT_DIE 2PLwithwait-and-diedeadlockprevention
TIMESTAMP Basic T/Oalgorithm
MVCC Multi-version T/O
OCC Optimisticconcurrencycontrol
HSTORE T/Owithpartition-levellocking
Two–PhaseLocking(2PL)
TimestampOrdering(T/O)
Partitioning
12
![Page 13: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/13.jpg)
H-Store
• Databasedividedintodisjointmemorysubsetscalledpartitions.• Eachpartitionprotectedbylocks.• Tx acquireslockstoallpartitionsitneedstoaccess.• DBMSassignsitatimestampandaddsittolockqueues.
13
![Page 14: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/14.jpg)
DBMSTestBed(1)Graphite:CPUsimulator,scalesupto1024cores.• Applicationthreadsmappedtosimulatedcorethreads.• Simulatedthreadsmappedtomultipleprocessesonhostmachines.
14
![Page 15: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/15.jpg)
DBMSTestBed(2)
• Implementedlight-weightpthread basedDBMS.• Allowstoswapdifferentconcurrencyschemes.• Ensuresnootherbottlenecksthanconcurrencycontrol.• Reportstransactionstatistics.
15
![Page 16: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/16.jpg)
GeneralOptimizations
1. MemoryAllocation:Custommalloc ,resizablememorypoolforeachthread.2.LockTable:Insteadofcentralizedlocktable,per-tuplelocks3.Mutexes:Avoidmutex oncriticalpath.- For2PL,centralizeddeadlockdetector- Fort/o:allocatinguniquetimestamps.
16
![Page 17: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/17.jpg)
Scalable2PL
1. DeadlockDetection- Makingdeadlockdetectorlockfreebykeepinglocalwait-forgraph.- Threadsearchesforcyclesinpartialwait-forgraph.
2.LockThrashing- Holdinglocksuntilcommit=>bottleneckinconcurrentTxs.- Timeoutthreshold:abortTx ifwaittimeexceedstimeout.
17
![Page 18: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/18.jpg)
ScalableT/O
1. TimestampAllocationa) Batchedatomicaddition- Managerreturnsmultipletimestampsforarequest.b)CPUclocks- Readlogicalclockofcore,concatenatewiththreadid.- requiressynchronizedclocks.c) Hardwarecounters- PhysicallylocatedatcenterofCPU.
18
![Page 19: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/19.jpg)
EvaluationRead-OnlyWorkload
19
![Page 20: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/20.jpg)
ReadOnlyWorkload
20
Ø 2PLschemesarescalableforreadonlybenchmarks
![Page 21: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/21.jpg)
ReadOnlyWorkload
21
Ø 2PLschemesarescalableforreadonlybenchmarksØ Timestampallocationlimitsscalability
![Page 22: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/22.jpg)
ReadOnlyWorkload
22
Ø 2PLschemesarescalableforreadonlybenchmarksØ TimestampallocationlimitsscalabilityØMemorycopyhurtsperformance
![Page 23: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/23.jpg)
WriteIntensive(mediumcontention)
23
No_Wait,Wait_Die scalesbetterthanothers.DL_Detect inhibitedbylockthrashing.
![Page 24: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/24.jpg)
WriteIntensive(Highcontention)
24
Ø Scalingstopsatsmallcorecount(64)
![Page 25: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/25.jpg)
WriteIntensive(Highcontention)
25
Ø Scalingstopsatsmallcorecount(64)ØNO_WAIThasgoodperformancebutfallsduetothrashing.
![Page 26: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/26.jpg)
WriteIntensive(Highcontention)
26
Ø Scalingstopsatsmallcorecount(64)ØNO_WAIThasgoodperformancebutfallsduetothrashing.ØOCCwinsat1000cores asoneTx alwayscommits.
![Page 27: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/27.jpg)
MoreAnalysis
1. ShortTransactions=>LowLockcontentionLongerTransactions=>Timestampallocationnotabottleneck.
2. Morereadtransactions=>Betterthroughput.
3. Multipartitiontransactions=>H-Storeschemeperformsbad.Partitionedworkloads=>H-Storebestalgorithm
27
![Page 28: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/28.jpg)
BottlenecksSummary
28
ConcurrencyControl
Waiting(Thrashing)
HighAbortRate
TimestampAllocation
Multi-partition
DL_DETECT
NO_WAIT
WAIT_DIE
TIMESTAMP
MULTIVERSION
OCC
HSTORE
![Page 29: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/29.jpg)
Summary
Allalgorithmsfailtoscaleascoreincreases.ØThrashing limitsthescalabilityof2PLalgorithmsØTimestampallocation limitsthescalabilityofT/Oalgorithms
29
![Page 30: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/30.jpg)
ProjectIdeas
• Newconcurrencycontrolapproachestotacklescalabilityproblem.• HardwaresolutionstoDBMSbottlenecksunsolvableinsoftwareside.• Hybridapproach:Switchb/wschemesdependingonworkload.
30
![Page 31: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/31.jpg)
Questions
31
![Page 32: ExpoLab - Staring into the Abyss: An Evaluation of Concurrency … into... · 2020. 10. 3. · Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores](https://reader033.vdocuments.us/reader033/viewer/2022052814/609c91360d6edd25ef6f1b33/html5/thumbnails/32.jpg)
Thrashing
32
v"uz"y"x"tuples
transactions A" B" C" D"
Locking Waiting