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

DMIT$10.9/月,日本VPS/三网直连/1核1.5G内存/20GB存储/1Gbps端口

优惠码年付一次性5折优惠码:TYO-Lite-Open-Beta-1y-50OFF永久8折优惠码:TYO-Lite-Open-Beta-Recur-20OFF日本vpsCPU内存SSD流量带宽价格购买1核1.5G20 GB4 TB1Gbps$10.9/月购买2核2 G40 GB6 TB1Gbps$16.9/月购买2核4 G60 GB8 TB1Gbps$21.9/月购买4核4 G80 GB12 TB...

RAKsmart裸机云/云服务器/VPS全场7折,独立服务器限量秒杀$30/月起

适逢中国农历新年,RAKsmart也发布了2月促销活动,裸机云、云服务器、VPS主机全场7折优惠,新用户注册送10美元,独立服务器每天限量秒杀最低30.62美元/月起,美国洛杉矶/圣何塞、日本、香港站群服务器大量补货,1-10Gbps大带宽、高IO等特色服务器抄底价格,机器可选大陆优化、国际BGP、精品网及CN2等线路,感兴趣的朋友可以持续关注下。裸机云新品7折,秒杀产品5台/天优惠码:Bare-...

湖北22元/月(昔日数据)云服务器,国内湖北十堰云服务器,首月6折

昔日数据怎么样?昔日数据新上了湖北十堰云服务器,湖北十堰市IDC数据中心 母鸡采用e5 2651v2 SSD MLC企业硬盘 rdid5阵列为数据护航 100G高防 超出防御峰值空路由2小时 不限制流量。目前,国内湖北十堰云服务器,首月6折火热销售限量30台价格低至22元/月。(注意:之前有个xrhost.cn也叫昔日数据,已经打不开了,一看网站LOGO和名称为同一家,有一定风险,所以尽量不要选择...

physicalmemory为你推荐
deduplicationchromeVTLHioseacceleratoraccess violation问题的解决办法!勒索病毒win7补丁求问win7 64位旗舰版怎么预防勒索病毒127.0.0.1DNS老是被修改为127.0.0.1,这是为什么?127.0.0.1为什么输入127.0.0.1无法打开页面ms17-010win10蒙林北冬虫夏草酒·10年原浆1*6 500ml 176,176是一瓶的价格还是一箱的价格联通版iphone4s苹果4S移动版和联通版有什么不同google图片搜索如何用google搜索空间照片googleadsense我申请Google AdSense要怎样才能通过Google AdSense呀?
黑龙江域名注册 免费linux主机 免费域名解析 kvmla cpanel主机 googleapps linkcloud 美国主机代购 nerd 南昌服务器托管 申请个人网页 linux空间 建立邮箱 bgp双线 河南m值兑换 hinet adroit 世界测速 亚马逊香港官网 服务器托管什么意思 更多