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
久久网云怎么样?久久网云好不好?久久网云是一家成立于2017年的主机服务商,致力于为用户提供高性价比稳定快速的主机托管服务,久久网云目前提供有美国免费主机、香港主机、韩国服务器、香港服务器、美国云服务器,香港荃湾CN2弹性云服务器。专注为个人开发者用户,中小型,大型企业用户提供一站式核心网络云端服务部署,促使用户云端部署化简为零,轻松快捷运用云计算!多年云计算领域服务经验,遍布亚太地区的海量节点为...
如今我们还有在做个人网站吗?随着自媒体和短视频的发展和兴起,包括我们很多WEB2.0产品的延续,当然也包括个人建站市场的低迷和用户关注的不同,有些个人已经不在做网站。但是,由于我们有些朋友出于网站的爱好或者说是有些项目还是基于PC端网站的,还是有网友抱有信心的,比如我们看到有一些老牌个人网站依旧在运行,且还有新网站的出现。今天在这篇文章中谈谈有网友问关于个人网站备案的问题。这个也是前几天有他在选择...
ATCLOUD.NET怎么样?ATCLOUD.NET主要提供KVM架构的VPS产品、LXC容器化产品、权威DNS智能解析、域名注册、SSL证书等海外网站建设服务。 其大部分数据中心是由OVH机房提供,其节点包括美国(俄勒冈、弗吉尼亚)、加拿大、英国、法国、德国以及新加坡。 提供超过480Gbps的DDoS高防保护,杜绝DDoS攻击骚扰,比较适合海外建站等业务。官方网站:点击访问ATCLOUD官网活...
physicalmemory为你推荐
竞赛搜狗拼音输入法4developedandroidcss3圆角怎样用css实现圆角矩形?iphonewifi为什么我的苹果手机连不上wifi谷歌sb为什么搜索SB第一个是google?win7关闭135端口win7系统怎么关闭135端口?网上很多方法都不好用!micromediaMacromedia翻译成中文是什么?googleadsense10分钟申请Google Adsense是一种怎样的体验phpemptyPHP~~什么时候用isset 什么时候用emptyipad无法加入网络我的IPAD无法加入网络
深圳域名空间 二级域名申请 大硬盘 liquidweb info域名 国外空间 web服务器架设软件 京东商城双十一活动 150邮箱 工信部icp备案号 网站卫士 vip域名 360云服务 申请网站 iki 测速电信 97rb 上海联通 windowsserver2012 中国域名根服务器 更多