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

Sharktech:美国/荷兰独立服务器,10Gbps端口/不限流量/免费DDoS防护60G,319美元/月起

sharktech怎么样?sharktech (鲨鱼机房)是一家成立于 2003 年的知名美国老牌主机商,又称鲨鱼机房或者SK 机房,一直主打高防系列产品,提供独立服务器租用业务和 VPS 主机,自营机房在美国洛杉矶、丹佛、芝加哥和荷兰阿姆斯特丹,所有产品均提供 DDoS 防护。此文只整理他们家10Gbps专用服务器,此外该系列所有服务器都受到高达 60Gbps(可升级到 100Gbps)的保护。...

两款半月湾 HMBcloud 春节88折日本和美国CN2 VPS主机套餐

春节期间我们很多朋友都在忙着吃好喝好,当然有时候也会偶然的上网看看。对于我们站长用户来说,基本上需要等到初八之后才会开工,现在有空就看看是否有商家的促销。这里看到来自HMBcloud半月湾服务商有提供两款春节机房方案的VPS主机88折促销活动,分别是来自洛杉矶CN2 GIA和日本CN2的方案。八八折优惠码:CNY-GIA第一、洛杉矶CN2 GIA美国原生IP地址、72小时退款保障、三网回程CN2 ...

哪个好Vultr搬瓦工和Vultr97%,搬瓦工和Vultr全方位比较!

搬瓦工和Vultr哪个好?搬瓦工和Vultr都是非常火爆的国外VPS,可以说是国内网友买的最多的两家,那么搬瓦工和Vultr哪个好?如果要选择VPS,首先我们要考虑成本、服务器质量以及产品的售后服务。老玩家都知道目前在国内最受欢迎的国外VPS服务商vultr和搬瓦工口碑都很不错。搬瓦工和Vultr哪个稳定?搬瓦工和Vultr哪个速度快?为了回答这些问题,本文从线路、速度、功能、售后等多方面对比这两...

physicalmemory为你推荐
unityios10如何设置浏览器允许弹出窗口courses163车轮163包过滤防火墙和灵巧网关设置"2014年全国民营企业招聘会现场A区域企业信息",,,,仪器win7模式ios8支持ipad勒索病毒win7补丁怎么删除 防勒索病毒 打的补丁
域名升级访问中 广州主机租用 已备案域名出售 sharktech Dedicated 国外私服 ssh帐号 lighttpd 商务主机 gspeed 秒杀汇 hktv 跟踪路由命令 宏讯 韩国代理ip smtp服务器地址 lamp兄弟连 注册阿里云邮箱 免费稳定空间 register.com 更多