Top Banner
Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores Xiangyao Yu 1 George Bezerra 1 Andrew Pavlo 2 Srinivas Devadas 1 Michael Stonebraker 1 1 CSAIL, Massachusetts Institute of Technology 2 Dept. of Computer Science Carnegie Mellon University Published in VLDB 2014 Presenter : Vaibhav Jain 1
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

Dec 24, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Thrashing

32

v"uz"y"x"tuples

transactions A" B" C" D"

Locking Waiting