seda: an architecture for well -conditioned, scalable internet … · 2015. 12. 7. · seda: an...

18
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University of California, Berkeley Operating Systems Principles (SOSP-18), Chateau Lake Louise, Canada, October 21-24, 2001.

Upload: others

Post on 20-Sep-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

SEDA:AnArchitectureforWell-Conditioned,ScalableInternetServices

MattWelsh,DavidCuller,andEricBrewerComputerScienceDivision

UniversityofCalifornia,Berkeley

OperatingSystemsPrinciples(SOSP-18),ChateauLakeLouise,Canada,October21-24,2001.

Page 2: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

Motivation

• MillionsofInternetusers• DemandforInternetservicesgrows• Highvariationsinserviceload.Loadspikesareexpected• Webservicesgettingmorecomplex• Notstaticcontentanymore,dynamiccontentthatrequireextensivecomputationandI/O

Page 3: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

Problemstatement

• Servicesthatsupportmillionsofusers(massiveconcurrency)• Responsive• Robust• Highlyavailable

• Wellconditionedservice:• Requestratescaleswiththeresponserate• Excessivedemanddoesnotdegradethroughputandallclientsexperienceanequalresponsetimepenaltylineartothelengthofthequeue(gracefuldegradation).

• Anotionoffairness

Page 4: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

Thread-basedconcurrency

• Contentionforresourcesandcontextswitchescausehighoverhead• Highnumberofthreadsdegradesthethroughputandresponsetimeisgreatlyincreased• PartialSolution:Boundnumberofthreads

• Throughputmaintained• Butwhataboutmaxresponsetime?Someclientsexperiencelongwaitingtimes

• Overcommittingresources• Transparentresourcevirtualizationpreventsapplicationfromadaptingtoloadchangesandspotting

bottlenecks

Page 5: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

Event-drivenconcurrency

• Efficientandscalableconcurrency• Butdifficulttoengineerandtune• Howordertheprocessingofevents.Schedulingchallenges• Difficultytofollowtheflowofevents• LittlesupportfromOS

Page 6: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

StagedEvent-DrivenArchitecture(SEDA)

• Hybridapproach• Thread-basedconcurrencymodelsforeaseofprogramming• Event-basedmodelsforextensiveconcurrency

• MainIdea:Decomposeserviceintostagesseparatedbyqueues• Eachstageperformsasubsetofrequestprocessing

Page 7: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

SEDA- Stage

• Eventqueuescanposevariouscontrolpolicies

• Modularity.Eachstageimplementedandmanagedindependently

• Expliciteventdeliveryfacilitatestracingflowofeventsandthusspottingbottlenecksanddebugging

Page 8: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

Controllers

• Threadpoolcontroller:idealdegreeofconcurrencyforastage• Adjustnumberofthreadsbyobservingtheincomingqueuelength• Idlethreadsareremoved

• Batchingcontroller:aimsatlowresponsetimeandhighthroughput• Batchingfactor:numberofeventsconsumedateachiterationoftheeventhandler

• Largebatchingfactor:morelocality,higherthroughput• Smallbatchingfactor:lowerresponsetime

Page 9: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

SEDAPrototype:Sandstorm

• ImplementedinJava• Javaprovidessoftwareengineeringbenefits

• Built-inthreading,automaticmemorymanagement

• APIsareprovidedfornaming,creatinganddestroyingstages,performingqueueoperations,controllingqueuethresholdsandprofilinganddebugging• AsynchronousI/OprimitivesareimplementedusingexistingOSprimitives.• Thesocketsinterfaceconsistsofthreestages:read,writeandlisten• AsynchronousI/Ofileoperations.

Page 10: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

Evaluation

• UsedthestaticfileloadfromSpecWEB99benchmark,arealistic,industry-standardbenchmark• 1to1024clientsmakingrepeatedrequests• Filessizesrangefrom102to921600Bytes• Totalfilesetsizeis3.31GB• MemoryCacheof200Mb• Serverrunningon4-waySMP500MHzPentiumIIIsystemwith2GBofRAM• 32machinesofasimilarconfigurationwereusedforloadgeneration

EvaluatedHaboobahigh-performanceSEDA-basedHTTPserver

Page 11: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

Otherdesigns• ApacheWebserver• Thread-basedconcurrency• Fixed-sizeprocesspoolof150processes

• FlashWebserver• Event-basedconcurrency• Singleprocesshandlingmostrequest-processingtasks.• Upto506simultaneousconnections(duetolimitationsofselectsystemcall).

• Haboob• Hybridapproach.Event-basedandthread-basedconcurrency• Upto1024concurrentrequests

Page 12: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

Evaluation

Page 13: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

Evaluation

• SEDAprovidessomefairness

• TheothertechniquessufferfromlongTCPretransmitbackoff times.Requestsrejectedandre-submitted

Page 14: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

Evaluation

• Underoverload• Requestswithhighcomputation

andI/Oneeds from1024clients

• Admissioncontrolpolicybyqueues• Canperformprioritizationorfilteringduringheavyload

• Adjustsizeofqueueaccordingtotheresponsetime

• Maintainlowresponsetime

Page 15: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

Summary

• Newdesignsneededfortheeverincreasingdemandsofwebservices• SEDAisthusproposedtoreachthedesiredperformance• Combinesthread-basedandevent-basedconcurrencymodels• Splitsanapplicationintoanetworkofstageswitheventqueuesinbetween• Dynamicresourcecontrollersforeachstage• Simplifiedbuildinghigh-concurrentservicesbydecouplingloadmanagementfromcoreapplicationlogic

Page 16: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

Strengths

• Highconcurrency.Abilitytoscaletolargenumbersofconcurrentrequests• Easeofengineering.Simplifyconstructionofwell-conditionedservices• Modularity.Eachstageimplementedandmanagedindependently• Adaptiontoloadvariations.Resourcemanagementadjusteddynamically.• Lowvarianceinresponsetime

Page 17: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

Weaknesses

• Increasedlatency.Arequesttraversemanystagesandexperiencesmultiplecontextswitchesandadditionaldelaysduetoqueuing.• Onalightlyloadedserver,theworstcasecontextswitchingoverheadcandominate

• Whatabouttheaveragecaseperformance?Istheworstresponsetimethemostimportantmetrictoconsider?

• Programmingstillharderthanthread-basedconcurrencymodels

Page 18: SEDA: An Architecture for Well -Conditioned, Scalable Internet … · 2015. 12. 7. · SEDA: An Architecture for Well -Conditioned, Scalable Internet Services Matt Welsh, David Culler,

Thankyou