您好,欢迎访问三七文档
LoadBalancingZbigniewJerzakSystemsEngineeringGroupDresdenUniversityofTechnologyIhave“stolen”mostoftheseslidesfrommycolleagues:UteWapplerandMartinSuesskrautThursday26thJanuary,2006,16:30zbigniew.jerzak@inf.tu-dresden.de1/34Thispresentationhasbeenbroughttoyouby...SystemsEngineeringGroupDresdenUniversityofTechnology2/34PartIMotivation3/34TheChallengeIInternethasanincreasingnumberofclientsIProvidinggoodservicetousershasalwaysbeenapriority,otherwisetheywillgotoyourcompetitorIOneshouldnotlimithimselftojustoneproviderIItmayfailIItmaybeoverloadedduetopeaktraffic4/34TheAimTheAimIntelligentlydistributeloadtomorethanoneserverPropertiesIHighutilizationofthesystemIOptimizedslowdown(waitingtimeprocessingtime)IFairnessIIncaseofstatefulprotocols:serveraffinityClientClientClientLoadBalancerServerServerServerClient...Figure1:LoadBalancer5/34DesiredFeaturesIScalabilityILoadsheddingIFailoverIHigheroverallavailabilityRequirement:everyserveriscapableofhandlingrequestsindependently–stateless/statefullissueIPotentialcostsaving:usinglow-costserversinsteadofhigher-costmultiprocessorsystems6/34RoundRobinRequestsareassignedtotheserversinarotatingmanner⇒equaldistributionofrequestsamongservers.BalancerServerServerServerClientClientClientClient...123542531Load4Figure2:RoundRobinLoadBalancer7/34RoundRobin–PropertiesAdvantages:IEasytoimplementDisadvantages:IProblematicassumptions:IAllrequestsconsumethesameamountofresourcesIAllserversarehomogeneousIDistributesloadregardlessofthecurrentnumberofconnectionsortheresponsetimeIUngracefuldegradationincaseofoverload8/34RoundRobin–UnderutilizedHomogeneousSystemFigure3:Source:[AOM+02]Figure4:Source:[AOM+02]9/34RoundRobin–OverutilizedHomogeneousSystemFigure5:Source:[AOM+02]Figure6:Source:[AOM+02]10/34RoundRobin–UnderutilizedHeterogeneousSystemFigure7:Thewholesystemisunderutilized,weakestserverisoverloaded.Source:[AOM+02]11/34RoundRobin–UnderutilizedHeterogeneousSystemFigure8:Averageutilizationofallservers.Figure9:Qlengthsattheservers.12/34WeightedRoundRobinISimilartoRoundRobinIRequestsareassignedaccordingtotheweightsofserversIHence⇒unequaldistributionofrequestsbetweenserversBalancerServerServerServerClientClientClientClient...123541Weight211234Load5Figure10:WeightedRoundRobinLoadBalancing13/34WeightedRoundRobin–PropertiesAdvantages:IEasytoimplementIAwareofthedifferentcapabilitiesoftheserversDisadvantages:IFixedweightsIWeightismanuallyassignedbyadministratorIUngracefuldegradationincaseofoverload14/34LeastLoadedIRequestsareassignedtotheleastloadedserver.IAdvantages:IAdaptsautomaticallytocurrentloadofserversIDisadvantages:IExpectedprocessingtimeofrequestsnotconsidered–inspectedonlytheQlengthILoadinformationrequiredIUngracefuldegradationincaseofoverload15/34ChoosingtheRightAlgorithmIAlgorithmshouldfittherequirementsIUsingcontextinformationmightyieldbetterresultsIShouldnotbetooexpensive→bottleneckISophisticatedadmissioncontrolfavoringpriviligedusersExampleIRoundRobinissufficientforloadbalancingforstaticHTMLpageshostedonhomogeneouswebserversIMoreadvancedalgorithmsformoredifficultcases16/34YouwillbeprovidedIImplementationoftheRoundRobinalgorithmIOMNeT++sourcecodeISimplestatistics17/34YourTaskIImplementadditionalloadbalancingpoliciesIWeightedRoundRobinILeastLoadedITestyoursolutionIIntroducemorerandomnessIGraphyourresults18/34WhatisOMNeT++IDiscrete,eventdrivensimulationenvironmentIComponent-basedandmodularIPrimaryapplicationarea:simulationofcommunicationnetworksIGenericarchitecturemakesuseinotherareaspossibleIStrongGUIsupportIWorksonWindows,Linux&MacMoreinformationanddownload:://(notobligatory)21/34Basics&DocumentationIOMNeT++simulationconsistsofINetworkdescription–.nedfilesINodes’logicimplementation–C++IConfiguration–omnetpp.iniIMessageimplementation–.msgfilesITakealookatthemanual(PDF)IConsulttheAPIdocumentation(HTML-Doxygen)ICheckouttheexamples(tictoc)22/34NetworkDescription(1)INetworksaredescribedin*.nedfilesINetworksconsistofinstancesofsimpleorcompoundmodulesconnectedbychannelsICompoundmodule:instantiatedmoduletypesconnectedbychannelsIThewholenetworkitselfisaninstanceofacompoundmodule23/34NetworkDescription(2)SimplemoduleIGatesIParametersIDisplaypropertiesCompoundmodulesISubmoduleinstantiationsIConnectionofgatesbychannelsIGatesIParameters24/34NetworkDescription–Example1simpleTxc12parameters:3myvalue:string;4gates:5in:in;6out:out;7endsimple89moduleTictoc10submodules:11tic:Txc1;12toc:Txc1;13connections:14tic.out−−toc.in;15tic.in−−toc.out;16endmodule1718networktictoc:Tictoc19endnetwork25/34NodeImplementation(1)IEachsimplemodulehastobeimplementedasaC++classIIncludeomnetpp.hISubclasscSimpleModuleoroneofitssubclassesIImplementinitialize()andhandleMessage()IPutallfiles(*.nedandC++files)intoonedirectory26/34NodeImplementation(2)1#includeomnetpp.h23
本文标题:Client Client Load Balancer Figure 1 Load Balancer
链接地址:https://www.777doc.com/doc-6073137 .html