maintainsphysicalmemory

physicalmemory  时间:2021-05-19  阅读:()
FinalMemoryOvercommit--WithouttheCommitment(XenSummit2008)Page1of3MemoryOvercommit…withoutthecommitmentDanMagenheimer,OracleCorp.
ExtendedAbstractforXenSummit,June2008IntroductionValuableresourcesinphysicalserversareoftenunderutilizedandvirtualizationcanbeemployedtoconsolidatemultiplephysicalserverssothatresourcesaremorefullyutilized.
IfaVMMcreatestheillusionthattherearemoreinstances(orbandwidth)ofaresourcethanactuallyphysicallyavailable,thatresourceisconsideredtobeovercommitted(oroversubscribed).
Forexample,ifthreeuniprocessorserversarevirtualized(asguests)andconsolidatedontoonedual-processorserver,theCPUresourceisconsideredovercommitted.
IfallthreeguestseachneedtorunworkloadsthatalwaysrequireanentireCPU,theseguestswouldbeconsideredpoorcandidatesforvirtualization.
But,virtualizationworksmostofthetimebecausemostresourcesonmanyphysicalserversarebadlyunderutilized.
Onekeyresourcehoweverisanotableexception:physicalmemory.
UnlikeCPUsandI/Ocards,anoperatingsystemonaphysicalsystemgenerallyutilizesitsphysicalmemoryfully.
Pagesofmemorythatarenotusedforkernel/applicationcodeordataareusedtocachediskdata.
Sincedisksareextremelyslowanditiscommonforthesamediskdatatobeusedagainandagain,awell-managedcacheofdiskpagescandramaticallyimproveperformanceofmanyworkloads.
Consequently,whenphysicalserversareconsolidated,itisconsideredunwisetoovercommitphysicalmemory.
Indeed,Xendoesnotsupportmemoryovercommitmentatall.
Forexample,ifonewishestoconsolidatemultiple1GBguestsona4GBXenserver,onlythreeguestscanbeaccomodated.
MemoryOvercommitmentElsewhereSomeVmwareproductsoptionallysupportmemoryovercommit.
Usingblack-boxmechanismsdescribedin[10],uptofivetimesasmanyguestscanberunwhenmemoryovercommitisenabled.
Inarecentblogposting[4],VmwareexploitsthiscapabilitytoarguethattheirproductsarelessexpensivethanXenorMicrosoftVirtualServerasmeasuredby"cost-per-virtual-machine".
Manyresponsestothisposting,argued:Realworldworkloadsdon'tbenefitMemoryischeap:justaddmorephysicalmemoryVmwaredoesn'trecommendturningitonanywayMigrationdoesn'tworkwithmemoryovercommitmentButthetruthisthatmanyworkloadsdobenefitfrommemoryovercommit,additionalmemoryisn'tapanacaea,Microsoftisworkingonit[8],andsoiskvm[5].
SowhynotXenMakingitmaximallyefficientisveryhardand(evenwithVmware)canleadtostabilityissues,functionalitylimitations,andsomelossofperformance.
ButcanXengetmostofthebenefit,withoutincurringthesecostsMemoryOvercommitmentMechanismsWaldspurgerin[10]describesthreeVMwaretechniques:Ballooningutilizesaspecialdriverthat"inflates"byrequestingmemoryfromthekernelandreturningittotheVMM.
Xenprovidesafunctioningballoondriverandsomelimitedtoolsforinteractingwithitbutnomanagement.
Wewillreturntoballooningshortly.
Content-basedpagesharingtransparentlydiscoversidenticalpagesandcombinesthem,usingcopy-on-writetoseparatethemagainwhennecessary.
ThishasbeenexploredonXenin[6]and[7].
Itiscomplextoimplement,haslimitedbenefitinnon-idledomains,andhasaperformanceimpact.
Indemandpaging,theVMMmaintainsaswapareaandcanpageoutmemorywithoutguestinvolvement.
Becauseoftheso-called"semanticgap"[2],aVMM-basedpagereplacementalgorithmcan'tbeefficientandcanleadtodoublepaging.
SinceXenhasnoI/Ocapabilityinthehypervisor,domain0wouldneedtomanageasystem-wideswaparea,whichleadstoevenmorecomplexityandinefficiency.
[9]suggeststhatmemoryhotplugcouldbeusedasanunderlyingmechanismand[3]suggeststhatentireguestsmightbeswappedout--justasentireprocesseswereswappedinearlyoperatingsystems;guestsareswappedinwhentriggeredbysomethinglikewake-on-LAN.
IsXenBallooningEnoughJustaswithCPUsandI/O,thephysicalmemoryinmostphysicalserversmayalsooftenbeunderutilized.
WhenaserverhasidleCPUs,muchofphysicalmemoryisholdingstaleapplicationdataordiskpagesthatmayneverbeusedagain.
Today'soperatingsystemsdoafinejobofoptimizingmemoryusagebyretainingpagesthatmightbeusedagainbutnooperatingsystemcanaccuratelypredictthefuture,sosome--andinmanycasesmost--ofitsguessesarewrong.
Asaresult,muchofthephysicalmemoryisidlememorythatisjusttakingupspaceandFinalMemoryOvercommit--WithouttheCommitment(XenSummit2008)Page2of3won'tbeusedagain.
Inotherwords,physicalmemorymaybefullyutilizedbutitisoftennotefficientlyutilized.
Aballoondriver,whenproperlymanaged,complementsnicelywiththeLinuxkernel'spagereplacementmechanisms.
Whentheballoonisinflatedbyonepage,thekernelsurrendersthepagethatitbelievesisleastlikelytobeusedagain.
Iftheballooncanbeinflateduntiljustbeforetheguest"hurts"formemory,theguest'sidlememorywillbeminimized,andXencanusethatotherwiseidlememoryforanotherguest.
Whenaguestneedsmorememory,itmustbeabletoquicklydeflatetheballoon;butifadditionalmemoryisunavailable,aproperlyconfiguredLinuxguestswapspagestodisk,justasifitreachedafixedlimitofphysicalmemory.
Thenwhenmemorylaterbecomesavailable,Linuxcanmakeuseofthatmemorytoswappagesinfromdiskifitneedsto.
In[11],gray-boxdataiscollectedtomanagemigrationstrategies.
Byusingasimilarapproachtoballooning,dataprovidedbyLinuxitselfcanbeusedtocontrolballooninflationanddeflation.
Specifically,theCommitted_ASstatisticin/proc/meminfoprovidesareasonableestimateofmemory"need"thatisconservative,reasonablyaccurate,anddynamic.
Byusingthisvaluetoinflateanddeflatetheballoonautomatically,aprocesswecallselfballooning,idlememoryappearstoberoughlyminimized.
Whataboutout-of-memory(OOM)conditionsAssumingLinuxhasbasicallyenoughmemoryand/orisgivenenoughtimetoadapttolow-memoryconditions,OOMsdon'thappen.
Aminimummemoryvalue(varyingdependingontotalmemoryavailable)wasrecentlyadded[1]totheXenballoondrivertoensuretheballoondoesn'tinflatetoomuch.
Andincludinghysteresisintheballooningalgorithm,ballooninflationcanberate-limitedsothatmemoryisneverreducedtooquicklyforLinuxtoadapt.
ImplementationAtfirst,wetriedmakingchangesintheXenballoondriveritself.
Becausesomekeymemorystatisticvariablesarenotexportedfromthekernel(eventhoughtheyareavailablein/proc),wedecidedtomoveallballoonmanagementintouser-mode.
Weimplemented,xenballoond,aguest-residentservice(daemon)writtenentirelyinbashscriptthatsupportsbothselfballooningand"directedballooning".
Forselfballooning,theguestneedonlyhavetheballoondriverinstalledeitherin-kernel(paravirtualized)orasakernelmodule(hardwarevirtualized).
Fordirectedballooning,theguestmustalsohaveafewxenstoretoolsinstalled;inthiscase,memorystatistics(proc/meminfoand/proc/vmstat)arecommunicatedviaxenbustodomain0andballoonsizecanbecalculatedandcontrolledbydomain0.
Wehavenotyetimplementedadirectedballooningmanagementtoolindomain0asselfballooningseemstobeworkingverynicelysofar.
TestingTotestxenballoond,wewroteasyntheticworkloadcalled"eatmem"thatmalloc'sarandom-sizedchunkofmemory(upto512MB)andthenwritestoeachpagerepeatedlyarandomnumberoftimes,thenfreesthememoryandsleepsforarandomnumberofseconds(upto63).
Thenthissequenceisrepeatedforeverandweuse/etc/rc.
localtoinvokethisworkloadautomaticallyforthelifetimeofthedomain.
Wealsomodifiedeatmemtousexenbustocommunicatehowlargethechunkofmemoryissothatwecanmonitoritfromdomain0.
Notethateachguestisassumedtobeconfiguredwithanadequatelysized(virtual)swapdisk.
Onthedomain0side,wewroteascripttolaunchdomainssequentially,watchingmemoryusagetodeterminewhenitisOKtolaunchanotherone.
Thenwewroteanotherscripttoprintcertainxenbuskeysforeachdomainandweusethe"watch"command(withdifferenceshighlighted)toprovideaxentop-likedisplaytomonitorthesevalues.
(SeeFigure1.
)Guestscanbeobserveddoingsomeswappingwheneatmemsuddenlyrequirestheballoontoberapidlydeflated,butthephenomenomistransientandinfrequent.
Thoughthisisfarfromanindustrial-strengthtestscaffold,itwassufficienttoverifythatselfballooningworks,thatmetricscanbemonitoredfromdomain0,andthatLinuxwascapableofhandlingrandomdynamiclargeinflationanddeflationoftheballoon.
Weranthisontwodifferent2GBmachinesrunningOracleVM(oneanolderlaptop)andoneachsuccessfullylaunchedsevenpvmdomainswhichwereconfiguredwithmemory=512andmaxmem=1024.
Onanothertestwithmoreaggressiveballooninflationassumptions,wewereabletolaunchfourteen512MBidledomains.
ConclusionsWhilecontent-basedpage-sharing,VMM-baseddemandpaging,andhotplugmemoryareallglamorousmechanismsthatcanbeusedtoimprovememoryefficiency,thesimpleexistingballoondriverprovidedbyXen,whencombinedwithgray-boxdatacollectedbyafewscripts,issufficienttoimplementreasonablememoryovercommit.
MoremeasurementandtestingisongoinginOracle'sOnDemandgroup,butwebelievethatthisverysimplesolutiondeliversthevastmajorityofthevalueofmemoryovercommitwithamuchsmallercost.
FinalMemoryOvercommit--WithouttheCommitment(XenSummit2008)Page3of3References1.
J.
Beulich,[PATCH]linux/balloon:don'tallowballooningdownadomainbelowareasonablelimit,,Xendevelopersarchive,http://lists.
xensource.
com/archives/html/xen-devel/2008-04/msg00143.
html2.
P.
Chenetal.
WhenVirtualisBetterthanReal.
InProceedingsHOTOS'01.
http://www.
eecs.
umich.
edu/~pmchen/papers/chen01.
pdf3.
K.
Fraser,RE:MemoryOvercommit,Xendevelopersarchivehttp://lists.
xensource.
com/archives/html/xen-devel/2005-12/msg00409.
html4.
E.
Horschman,CheapHypervisors:AFineIdea--Ifyoucanaffordthem,blogposting,http://blogs.
vmware.
com/virtualreality/2008/03/cheap-hyperviso.
html5.
A.
Kivity,Memoryovercommitwithkvm,http://avikivity.
blogspot.
com/2008/04/memory-overcommit-with-kvm.
html6.
J.
Klosteretal,Onthefeasibilityofmemorysharing:contentbasedpagesharinginthexenvirtualmachinemonitor,TechnicalReport,2006.
http://www.
cs.
aau.
dk/library/files/rapbibfiles1/1150283144.
pdf7.
G.
Milos,MemoryCOWinXen,PresentationatXenSummit,Nov2007.
http://www.
xen.
org/files/xensummit_fall2007/18_GregorMilos.
pdf8.
J.
Oneill,ExpensiveHypervisors,abadideaevenifyoucanaffordthem.
blogpostinghttp://blogs.
technet.
com/jamesone/archive/2008/03/13/expensive-hypervisors-a-bad-idea-even-if-you-can-afford-them.
aspx9.
J.
Schoppetal,ResizingMemorywithBalloonsandHotplug,OttawaLinuxSymposium2006,https://ols2006.
108.
redhat.
com/reprints/schopp-reprint.
pdf10.
C.
Waldspurger.
MemoryResourceManagementinVmwareESXServer,InProceedingsOSDI'02,http://www.
usenix.
org/events/osdi02/tech/walspurger/waldspurger.
pdf11.
T.
Wood,etal.
Black-boxandGray-boxStrategiesforVirtualMachineMigration,InProceedingsNSDI'07.
http://www.
cs.
umass.
edu/~twood/pubs/NSDI07.
pdfFigure1.
Memory-overcommitedmachineshowingmemoryusagemonitorforselfballoonedguests

蓝速数据(58/年)秒杀服务器独立1核2G 1M

蓝速数据金秋上云季2G58/年怎么样?蓝速数据物理机拼团0元购劲爆?蓝速数据服务器秒杀爆产品好不好?蓝速数据是广州五联科技信息有限公司旗下品牌云计算平台、采用国内首选Zkeys公有云建设多种开通方式、具有IDC、ISP从业资格证IDC运营商新老用户值得信赖的商家。我司主要从事内地的枣庄、宿迁、深圳、绍兴、成都(市、县)。待开放地区:北京、广州、十堰、西安、镇江(市、县)。等地区数据中心业务,均KV...

RAKsmart 黑色星期五云服务器七折优惠 站群服务器首月半价

一年一度的黑色星期五和网络星期一活动陆续到来,看到各大服务商都有发布促销活动。同时RAKsmart商家我们也是比较熟悉的,这次是继双十一活动之后的促销活动。在活动产品中基本上沿袭双11的活动策略,比如有提供云服务器七折优惠,站群服务器首月半价、还有新人赠送红包等活动。如果我们有需要RAKsmart商家VPS、云服务器、独立服务器等产品的可以看看他们家的活动。这次活动截止到11月30日。第一、限时限...

FBICDN,0.1元解决伪墙/假墙攻击,超500 Gbps DDos 防御,每天免费流量高达100G,免费高防网站加速服务

最近很多网站都遭受到了伪墙/假墙攻击,导致网站流量大跌,间歇性打不开网站。这是一种新型的攻击方式,攻击者利用GWF规则漏洞,使用国内服务器绑定host的方式来触发GWF的自动过滤机制,造成GWF暂时性屏蔽你的网站和服务器IP(大概15分钟左右),使你的网站在国内无法打开,如果攻击请求不断,那么你的网站就会是一个一直无法正常访问的状态。常规解决办法:1,快速备案后使用国内服务器,2,使用国内免备案服...

physicalmemory为你推荐
腾讯周鸿祎TableBasicAbnormallyStoppedServicesitunes菏泽市牡丹区实验小学JAN-201f20;BACKGROUND-COLOR:#4ae2f7">16Telewizjamedia支持ipad买家google支持ipad支持ipad重庆宽带测速重庆哪一种宽带网速最快
二级域名 网址域名注册 linuxvps vps优惠码cnyvps 花生壳免费域名 免费cn域名 yardvps blackfriday 博客主机 鲨鱼机 web服务器架设软件 域名转接 linux服务器维护 免费申请个人网站 福建铁通 美国独立日 登陆空间 空间登入 便宜空间 网站加速 更多