cache modeling and optimization using miniature simulations · slide experiments •construct mrc...
TRANSCRIPT
![Page 1: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/1.jpg)
CacheModelingandOptimizationusingMiniatureSimulations
USENIXAnnualTechnicalConference(ATC’17)July13,2017
CarlWaldspurger CachePhysics,Inc.Trausti Saemundsson CachePhysics,Inc.IrfanAhmad CachePhysics,Inc.NohhyunPark DatosIO,Inc.
![Page 2: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/2.jpg)
Motivation• Cachingimportant,ubiquitous• Optimizevaluablecacheresources– Improveperformance,QoS– Sizing,partitioning,tuning,cliffremoval,…
• Problem:needaccurate,efficientmodels– Complexpolicies,non-linear,workload-dependent– Nogeneral,lightweight,onlineapproach
CachePhysics, Inc. USENIXATC’17 2
![Page 3: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/3.jpg)
CacheModeling
�
���
���
���
���
���
���
���
���
� �� �� �� �� �� �� �� ��
���������
����� ���� ����
• Cacheutilitycurves– Performanceasf(size,…)– Missratiocurve(MRC)– Latencycurve
• Observations– Non-linear,cliffs– Non-monotonicbumps
CachePhysics, Inc. USENIXATC’17 3
![Page 4: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/4.jpg)
CounterStacks[OSDI’14]SHARDS[FAST’15]AET[ATC’16]
MRCConstructionMethods
Exact ApproximateStack AlgorithmsLRU,LFU,…
Any AlgorithmARC,LIRS, 2Q,FIFO,…
CachePhysics, Inc. USENIXATC’17 4
Mattsonalgorithmallsizesatonce
separatesimulationforeachcachesize
CounterStacks[OSDI’14]SHARDS[FAST’15]AET[ATC’16]
miniaturesimulation[ATC’17]
![Page 5: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/5.jpg)
MiniatureSimulation• Simulatelargecacheusingtinyone• Scaledownreferencestream,cachesize– Randomsamplingbasedonhash(key)– Assumesstatisticalself-similarity
• Rununmodifiedalgorithm– LRU,LIRS,ARC,2Q,FIFO,OPT,…– Trackusualstats
CachePhysics, Inc. USENIXATC’17 5
![Page 6: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/6.jpg)
ScalingDown
CachePhysics, Inc. USENIXATC'17 6
refs cache
≈2×
halfkeyspace
halfsizehashkeys(colors)
![Page 7: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/7.jpg)
ScalingDown
CachePhysics, Inc. USENIXATC'17 7
refs cache
≈8×
![Page 8: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/8.jpg)
ScalingDown
CachePhysics, Inc. USENIXATC'17 8
refs cache
≈32×
![Page 9: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/9.jpg)
ScalingDown
CachePhysics, Inc. USENIXATC'17 9
refs cache
≈128×
![Page 10: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/10.jpg)
FlexibleScaling
CachePhysics, Inc. USENIXATC'17 10
Smminisize
samplingrateR
Seemulatedsize
Sm =R × Se
• Time/spacetradeoff– Fixedsamplingrate R– FixedminisizeSm
• Example:Se =1M– R =0.005⇒ Sm=5000– Sm=1000⇒ R =0.001
![Page 11: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/11.jpg)
ExampleMini-SimMRCs
CachePhysics, Inc. USENIXATC’17 11
![Page 12: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/12.jpg)
Mini-SimAccuracy
CachePhysics, Inc. USENIXATC'17 12
• 137real-worldtraces– Storageblocktraces– CloudPhysics,MSR,FIU– 100cachesizespertrace
• MeanAbsoluteError– |exact– approx|– Averageoverallsizes
![Page 13: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/13.jpg)
Mini-SimEfficiency• Variablecosts
– BothspaceandtimescaleddownbyR– R=0.001⇒ simulation1000× smaller,1000× faster
• Fixedcosts– Hashingoverheadforsampling– Footprintforcode,libraries,etc.
• Netimprovement– R=0.001⇒ ~200× smaller,~10× faster– Closerto1000× ifexistingkeyhashormultiplesims
CachePhysics, Inc. USENIXATC'17 13
![Page 14: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/14.jpg)
Mini-SimCacheTuning• Dynamicmulti-modeloptimization– Simulatecandidateconfigurationsonline– Periodicallyapplybesttoactualcache
• Parameteradaptationexperiments– LIRSS stacksize,5mini-simswithf=1.1— 3– 2QA1out size,8mini-simswithKout =50%— 300%– R =0.005,epoch=1Mrefs
CachePhysics, Inc. USENIXATC’17 14
![Page 15: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/15.jpg)
LIRSAdaptationExamples
CachePhysics, Inc. USENIXATC’17 15
![Page 16: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/16.jpg)
2QAdaptationExamples
CachePhysics, Inc. USENIXATC’17 16
![Page 17: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/17.jpg)
TalusCliffRemoval
CachePhysics, Inc. USENIXATC'17 17
• Talus[HPCA’15]– NeedsMRCasinput– Interpolatesconvexhull
• Shadowpartitions𝛼,𝛽– Steerdifferentfractionsofrefstoeach
– Emulatecachesizesonconvexhullviahashing
𝛼
𝛽
![Page 18: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/18.jpg)
TalusforNon-LRUPolicies?• NeedefficientonlineMRCs• Supportdynamicchanges?–WorkloadandMRCevolveovertime– Resizepartitions,lazyvs.eager?–Migratecacheentriesin“wrong”partition?
• Notclearhowtomerge/migratestateCachePhysics, Inc. USENIXATC’17 18
![Page 19: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/19.jpg)
SLIDE:TransparentCliffRemoval• ShardedListwithInternalDifferentialEviction– Singleunifiedcache,nohardpartitions– Deferpartitioningdecisionsuntileviction– Avoidsresizing,migration,complexityissues
• NewSLIDElistabstraction– NochangestoARC,LIRS,2Q,LRUcode– ReplacesinternalLRU/FIFObuildingblocks
CachePhysics, Inc. USENIXATC’17 19
![Page 20: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/20.jpg)
SLIDEList• Augmentconventionallist– Per-itemhashvalue– Hashthresholddeterminescurrent“partition”
• Itemstotallyordered,nohardpartitions• Evictfromtailofover-quotapartition
CachePhysics, Inc. USENIXATC’17 20
![Page 21: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/21.jpg)
SLIDEExperiments• ConstructMRConline– 7mini-sims{⅛,¼,½,1,2,4,8}× cachesize– R=0.005,smoothedmissratios
• UpdateSLIDEsettingsperiodically– Discreteconvexhulleveryepoch(1Mrefs)– Setnew“partition”targetsforSLIDElists
CachePhysics, Inc. USENIXATC’17 21
![Page 22: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/22.jpg)
SLIDE:CliffReduction
CachePhysics, Inc. USENIXATC’17 22
69%ofpotentialgain
48% 38%
![Page 23: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/23.jpg)
SLIDE:LittleImpactwithoutCliffs
CachePhysics, Inc. USENIXATC’17 23
![Page 24: Cache Modeling and Optimization using Miniature Simulations · SLIDE Experiments •Construct MRC online –7 mini-sims {⅛, ¼, ½, 1, 2, 4, 8} ×cache size –R=0.005, smoothed](https://reader034.vdocuments.us/reader034/viewer/2022051511/600ce08bd9e78a0d4a4b7c9d/html5/thumbnails/24.jpg)
Conclusions• Mini-simextremelyeffective– Robust,generalmethod(ARC,LIRS,2Q,LRU,OPT,…)– Averageerror<0.01with0.1%sampling
• Canoptimizeworkloads/policiesautomatically– Dynamicparametertuning– SLIDEtransparentcliffremoval
CachePhysics, Inc. USENIXATC’17 24