vm memory vram sizing considerations
TRANSCRIPT
-
8/2/2019 Vm Memory Vram Sizing Considerations
1/17
VMMemory(vRAM)Sizing
ConsiderationsChallenges and considerations in determining how
much memory to allocate to virtual machines
WHITEPAPERBYDAVIDDAVISANDBRADBONN
-
8/2/2019 Vm Memory Vram Sizing Considerations
2/17
TableofContentsIntroduction.................................................................................................................................................. 2
MemoryUsagethroughDifferentLevelsoftheVirtualizationStack........................................................... 3
MemoryBallooning............................................................................................................................... 4
TransparentPageSharing..................................................................................................................... 5
MemoryCompression........................................................................................................................... 5
VMwarePerformanceMetricstouseforVMMemoryUsageAnalysis....................................................... 5
DeterminingifaVMhasMemoryrelatedPerformanceProblems.......................................................... 7
AdditionalFactorstoKeepinMindwhenSizingVMMemory..................................................................... 8
MemoryHogApplications..................................................................................................................... 8
Limits......................................................................................................................................................... 8
Reservations..............................................................................................................................................
8
KnowinganApplicationsNeeds............................................................................................................... 9
InstitutingaVMMemorySizingProcess...................................................................................................... 9
DeterminingTimeFrameforAnalysis..................................................................................................... 10
FindingthePeakValue............................................................................................................................ 11
ComparingthePeakUsageValuetoAllocatedMemory........................................................................ 11
ForecastingUsageChangesuntilNextMemoryVMAllocationReview................................................. 12
FactorinaBufferValue.......................................................................................................................... 12
ChangetheVMSizingAllocationandDocumenttheChange................................................................ 12
SettingUpaRegularMemoryReviewBasedonanAppropriateTimeframe........................................ 13
ProvisioningaNewVMforAppropriateMemoryAllocations................................................................... 13
InitiallyAllocatetheMinimumPossible.................................................................................................. 14
MonitorMemoryMetricsIntensely....................................................................................................... 14
AddMoreMemoryinSmallIncrements................................................................................................. 15
AddtheNewVMtotheRegularMemorySizingReviewProcess.......................................................... 15
Conclusion...................................................................................................................................................
15
AbouttheAuthor.................................................................................................................................... 16
AbouttheSponsor.................................................................................................................................. 16
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 1
-
8/2/2019 Vm Memory Vram Sizing Considerations
3/17
IntroductionWhensizingvirtualmachinesavirtualizationadministratormustselectthenumberofvCPUs,thesizeof
thevirtualdisk,thenumberofvNICs,andtheamountofmemory.Outofallthoseresources,the
amountofmemoryallocatedtoeachvirtualmachine(VM)isoftenthemostdifficulttodetermine.This
isbecausememoryisthemostdynamicandleastpredictableofthoseresources.
VirtualizationadministratorsshouldavoidoverallocatingmemorytotheirVMsbecausedoingsocan
wasteexpensiveserverresourcesandwill,therefore,minimizethereturnontheinvestment(ROI)in
thatinfrastructure.Ontheotherhand,thebusinesscriticalapplicationsrunningonvirtualmachines
alsoneedtomaintainhighperformance,andthelastthingavirtualizationadministratorwantsisto
haveperformancecomplaintsfromendusers.
VMadministratorsoftenfacedifficultlyinbalancingtheneedtomaximizeROIoftheserverhardware
andtherequirementforapplicationstoperformwell.Fortunately,withVMware'smemoryover
commitmentcapabilitiesandtheguidancefromthiswhitepaper,virtualizationadministratorswillgaina
deeperunderstanding
about
how
to
make
VM
memory
sizing
more
straightforward
and
less
of
apainful
trialanderrorprocess.Byreadingthiswhitepaper,VMadministratorswilllearn:
Howmemoryusageworksatdifferentlevelsofthevirtualizationstack(seeFigure1)
ThechallengesindeterminingaVMsmemoryrequirements
HowtoscreenformemorybasedVMperformanceissuesbeforeattemptingtooptimizean
environment
HowtoapproachappropriatesizingofnewVMsthatneedtobedeployed
Howtoinstitutearegularmemorysizingprocessforthedatacenter
WhatVMperformancemetricsprovidethebestinsightsonmemoryusageandhowtoaccess
these
Figure1TheVirtualizationStack
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 2
-
8/2/2019 Vm Memory Vram Sizing Considerations
4/17
MemoryUsagethroughDifferentLevelsoftheVirtualizationStackPhysicalmemoryonthehostismanagedbythehypervisor,andthehypervisorloadsthismemoryjust
likeanyotheroperatingsystemdoes. VMsloadedinthehypervisorwillincreasethememoryutilization
incrementallyasuserscreatevirtualmachines.OncetheguestOSisrunningandtheapplicationsload,
theguestOSbelievesthatitownsallthevirtualmemorythathasbeenconfigured(justasitdoesona
physicalserver)andwilloften"pindown"largeblocksofmemorytocacheitforfutureuse.
Itisimportanttonotethatvirtualizationisnotapanaceaandthereismemoryoverheadassociatedwith
usingthistechnology.Guestsandtheirapplicationswillneverhaveaccesstothesameamountof
physicalmemoryinstalledonthehost.Thereisanadditionalquantityofphysicalmemorythatisused
upwitheachvirtualmachinepoweredoninthehypervisor,andtheamountofoverheadisdetermined
bythevirtualresourcesthathavebeenallocatedtotheVM(seefigure2). Largeramountsofvirtual
RAMandadditionalvCPUsincreasetheoverheadmemoryamountonthehost(seefigure3).
Figure2TheImpactstoAvailableMemoryforanApplicationfromVMandGuestOverhead
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 3
-
8/2/2019 Vm Memory Vram Sizing Considerations
5/17
Figure3VM
Overhead
Table
SOURCE:FROM VMWARE.COM
(HTTP://PUBS.VMWARE.COM/VSP40_ I/WWHELP/WWHIMPL/COMMON/HTML/WWHELP.HTM#HREF=RESMGMT/R_OVERHEAD_MEMORY_ON_
VIRTUAL_MACHINES.HTML#1_7_9_9_10_1&SINGLE=TRU)
Virtualizationadministratorscanthinkofmemoryasa"timeshare"whereitisprovidedtoeachvirtual
machine,asneeded,andfreedupwhenavailabletobeusedbyanothervirtualmachine,alsoas
needed.
VMwareemploysavarietyoffeaturesthatmakememoryovercommitmentpossible.Withoutsuch
featureslikememoryballooning,transparentpagesharing(TPS),andcompression,anESX/ESXiserver
wouldsimplyrunoutofmemoryandcrash.
MemoryBallooning
WhenanadministratorinstallsVMwareTools,thememctldriver(a.k.a.ballooningdriver)isinstalledin
theguestOS.ThisdrivercreatesabubbleorballoonofmemoryconsumedinsidetheguestsotheOS
seesitasbeingusedbyanapplication.ThehypervisorthentakesthephysicalRAMfreedupbyinflating
thisballoonandallocatesittootherVMsthatrequireit.
Memoryballooningintroducesasmallamountofprocessingoverhead,andifitforcesaguestOSto
beginpagingtodisk,thiscansignificantlyslowdowntheapplication(s)ontheVM. IftheVMisntusing
thememory,
then
ballooning
itself
isnt
aserious
performance
issue,
but
it
is
an
indication
that
physical
memoryonthehostisbecomingscarce.
Oneofthebiggestadvantagesofmemoryballooningoverothermethodsforhandlingmemoryover
commitmentisthatthememoryballooningdriverallowstheguestoperatingsystemtochoosewhich
pagesarerelinquishedtothehypervisorforotherVMs. Thisway,pageswhicharentinactiveusecan
besafelyfreedup,causingalmostnoperformanceimpactfromtheguestsperspective.
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 4
http://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=truehttp://pubs.vmware.com/vsp40_i/wwhelp/wwhimpl/common/html/wwhelp.htm#href=resmgmt/r_overhead_memory_on_virtual_machines.html#1_7_9_9_10_1&single=true -
8/2/2019 Vm Memory Vram Sizing Considerations
6/17
TransparentPageSharing
Transparentpagesharingisthededuplicationofmemorythatpermitsidenticalvirtualmemorypages
tobecollapsedintoasinglepagewithinthehostsphysicalRAM,therebyfreeingupmemoryforother
uses.Forexample,ifmultiplevirtualmachinesonahostareallrunningthesameoperatingsystemand
application,thehypervisorwillcomparepagesofmemorythroughhashingtolocateidenticalpagesthat
canbe
freed
up
through
their
consolidation.
Ballooning
and
transparent
page
sharing
work
together
to
ensurethatovercommittedmemorydoesn'tcauseperformanceissuesfortheapplicationsintheguest
virtualmachines.
MemoryCompression
MemorycompressionanddiskswappingbythehypervisorarethelastditcheffortsbyESX/ESXitokeep
thehypervisorfromcrashingwhenmemoryresourcesonthehostarestretchedtothebreakingpoint.
Thecompressionofmemorypagesbythehypervisoralsocausesadditionalprocessingoverhead;
however,thisoverheadissmallincomparisontotheslowdowncausedbyswappingpagesouttoa
storagedevice. UsersofvSphere4.1andabovewillbeabletotakeadvantageofthisfeaturetoreduce
theamount
of
swapping
taking
place
when
physical
memory
resources
are
close
to
being
exhausted.
VMwarePerformanceMetricstouseforVMMemoryUsageAnalysisVirtualizationadministratorsshouldtakethetimetobecomefamiliarwithcriticalvSpherecountersthat
areusedtoanalyzememoryperformance.ThesecounterscanhelppreventVMmemoryperformance
issues,aswellashelpresolvethemwhentheyoccur.
ThetwomostcommonlyusedvSpherememorymetricsarememoryactiveandmemoryconsumed.
Normally,whenviewingmemoryusageonaVMwithintheVIclient,thememoryactivemetricis
displayed
(see
Figures
4
and
5).
The
memory
consumed
metric
is
displayed
by
default
at
the
host
level.
AverageMemoryActiveinKB(memory.active.average)ThisistheamountofmemorythattheguestVMisactivelyusing,andisestimatedbasedonrecentlytouchedpages(thesmallest
ofactive,consumed,andgranted).Monitorthismetricforahighmemoryactivethresholdthat
isapproachingtotalmemorycapacityonthehost. Thismetricdoesntshowthefullfootprint
ofaVMinmemory,soitcantbeusedreliablyfordeterminingaVMsminimummemory
requirements. However,itdoesgivevisibilityintohowmuchmemorypagingactivityistaking
place,andsocanbeusedtojudgewhethertheapplicationsonaVMareengagedoridle.
AverageMemoryConsumedinKB(memory.consumed.average)Thisistheamountofguestphysical
memory
consumed
by
the
virtual
machine
for
guest
memory,
and
is
calculated
as
the
amountofmemorygranted(configuredfortheVM)lesstheamountofmemorysavedby
memorysharingtechniques. Thismetrichasclassicallybeenthebetterchoicefordetermining
whatavirtualmachinestotalmemoryrequirementsare;however,thereareadditional
complexitiesthatcanmakeitlesshelpfulonmoderninstallations. Factorssuchaslarge
memorypages,transparentpagesharing,andcachingactivitywithintheguestcancausethis
metrictobecomelessinformative.
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 5
-
8/2/2019 Vm Memory Vram Sizing Considerations
7/17
Figure4AMemoryUtilizationChartfromwithinVMwarevCenter
Figure5vSphereCountersforMeasuringMemoryPerformanceWhilememoryactiveandmemoryconsumedaretypicallythetwomosttellingVMmemorymetrics,
therearemanymorethatcanbeusedtolearnaboutmemoryconsumption,allocation,andsharing.
MoreinformationonVMwarememorymetricscanbefoundhere:
http://www.vmware.com/support/developer/vc
sdk/visdk400pubs/ReferenceGuide/memory_counters.html
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 6
-
8/2/2019 Vm Memory Vram Sizing Considerations
8/17
Forexample,whenahostorvirtualmachineisswappingouttodisk,thisisanimmediateindicatorofa
memoryproblem.StatisticslikeAverageMemorySwappedinKB(memory.swapped.average)and
AverageMemoryReclaimedbyBallooning(mem.vmmemctl.average)showthataVMishavingtoswap
oremployballooningtogetthememorythatisneeded.
Evenwhen
avirtual
machine
guest
OS
is
no
longer
connected
to
physical
hardware,
it
can
still
be
useful
introubleshootingperformanceproblems.Theguestcandeterminewhatapplicationsarerunningand
howmuchmemorythoseapplicationsareusing.Ifthoseapplicationsarebusinesscriticalandneed
morememory,theVMmemoryshouldberesized.Also,itisessentialtohaveVMwareToolsinstalledso
thatthehosthastheabilitytoemployballooningifthereisanymemorycontention.
Knowingwhichmetricstoevaluateisnotenoughtodetermineadequatememorysizing.Topreventand
solvevSpherememoryperformanceissues,itisimportanttonotethethresholdsforthosemetrics,
whichwhencrossed,areindicativeofVMperformanceissues.Herearefoursuchthresholdsthatare
importanttoknow:
Highhostmemoryconsumption>80%(memory.active.average)
HighVMmemoryconsumption>7590%(insidetheguestOS)
HostorVMSwapping(onthehost,memory.swapped.average)>0
VMBallooning(mem.vmmemctl.average)>0
Anotherfactortoconsideristheuseoflargememorypages.Largememorypagesincreasethe
performanceofmemorytranslationsforapplicationsthatuselargeamountsofmemory.Largememory
pagesareenabledbydefaultinESX/ESXi,butmustalsobeenabledintheguestoperatingsystem.For
moreinformationontheperformanceoflargepageswithvSphere,consultVMwaresLargePage
PerformanceStudy.FormoreinformationonvSphereMemoryResourceManagementseeVMware:
UnderstandingMemoryResourceManagementinVMwareESXServer.
DeterminingifaVMhasMemory-relatedPerformanceProblems
IfaVMisalreadyexperiencingaperformanceproblemrelatedtomemory,thentheavailableRAMis
insufficientwhetherduetovirtualmemoryassignedtotheVMorthephysicalmemoryinstalledonthe
host.Indicatorsofanimpendinghostorclusterwidememoryshortageincludewhenactivememory
approachestotalmemoryand/orwhenswappingisoccurringfrequently.Ifhostmemoryistheproblem,
eitherthereisnotenoughorthedistributedresourcescheduler(DRS)isnotbeingusedproperlyto
balancethememoryloadacrossotherhosts.
Inadditiontothephysicalhostmemoryshortagethatmanysystemadministratorsarefamiliarwithona
traditionalserver(notusingvirtualization),thereareotherwaysthatmemoryshortagescanoccurina
virtualizedenvironment.
VMmemoryshortagescanoccurifresourcecontrolsareconfiguredincorrectly(perhapsareservation
orlimithasbeensetinadequately)ortoomanymemoryintensivevirtualmachineshavebeendeployed
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 7
http://www.vmware.com/files/pdf/large_pg_performance.pdfhttp://www.vmware.com/files/pdf/large_pg_performance.pdfhttp://www.vmware.com/files/pdf/large_pg_performance.pdfhttp://www.vmware.com/files/pdf/large_pg_performance.pdfhttp://www.vmware.com/files/pdf/large_pg_performance.pdfhttp://www.vmware.com/files/pdf/large_pg_performance.pdfhttp://www.vmware.com/files/pdf/large_pg_performance.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdfhttp://www.vmware.com/files/pdf/large_pg_performance.pdfhttp://www.vmware.com/files/pdf/large_pg_performance.pdf -
8/2/2019 Vm Memory Vram Sizing Considerations
9/17
onasingleserver.Toidentifyavirtualmachinememoryshortage,administratorsshouldanalyze
memoryresourcesettings(reservationsandlimits,whicharecoveredbelow),aswellasoverallVM
memorydemands.
AnotherpossibilityisthatVMshavebeengrosslyovercommittedandmemoryoverheadassociated
withthose
over
commitments
is
consuming
too
much
memory
resources.
The
amount
of
memory
being
usedformanagingmemory,perESX/ESXihost,isavailablebymonitoringthemem.overhead.average
counter.
Finally,applicationlevelmemoryshortagescanoccurinsidetheguestOSifthereisamemoryleakinan
applicationortherearesimplytoomanyapplicationsdemandingmemoryfortheamountofvirtual
memoryallocated.Toidentifyanapplicationlevelmemoryshortage,administratorscanlookinsidethe
guestOS,justastheywouldonatraditionalphysicalserver,startingwithWindowsTaskManager.
AdditionalFactors
to
Keep
in
Mind
when
Sizing
VM
Memory
MemoryHogApplications
Certainapplicationsaredesignedtobe"memoryhogs".No,thisisnotareferencetomalicious
applications.Instead,thereferenceistoapplicationsthatmaybequitefamiliartomostdatacenters,
suchasanExchangeServer,OracleDB,oraSQLdatabase.Theseapplications(andothers)aredesigned
toreserve(cache)allavailablememorywhentheystart.Whilethisworksfinewhentheapplicationis
runningonaphysicalserver,itisthemostinefficientwaytomanagememorywhentheapplicationis
runningasavirtualmachine. Checkwiththeapplicationvendortodeterminewhatthetruememory
needsareforthedeploymentasaVM,andsupplementthatinformationwithalookatthememory
activemetric
within
the
VM
to
determine
just
how
much
of
the
memory
is
being
actively
accessed.
Limits
Byconfiguringalimitonavirtualmachine,acapisplacedonthemaximumamountofmemorythatthe
VMcanuse.Withoutalimit,theallocatedmemoryisthelimitforthevirtualmachine.Limitsare
enforcedbyVMwareToolsthroughmemoryballooning,whichkeepstheVMfromutilizingmemory
abovethelimitsetting.
VMmemorylimitsareoftenputinplacebyadministratorwhomaynothavefullyunderstoodthepoor
performanceandwastedresourcesthatlimitscancreate.Whenlookingatmemoryutilization,these
memorylimits
skew
the
memory
metrics
and
can
cause
confusion
while
troubleshooting.
As
general
practice,memorylimitsarenotrecommendedbyVMwareexceptinrarecasesofseriousphysical
memorycontention.
Reservations
Memoryreservationssettheminimumamountofmemorythatavirtualmachine(orresourcepool)can
access.EventhoughthatmemorymaynotbeneededbytheVMatalltimes,areservation,ineffect,
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 8
-
8/2/2019 Vm Memory Vram Sizing Considerations
10/17
pullsthatmemoryawayfromallothervirtualmachinesthatmayneedit.Likelimits,reservationsare
bettersetonresourcepoolsratherthanonindividualvirtualmachines,astheycanaffectthe
performanceofothervirtualmachinesandskewmemorymetrics.
KnowinganApplicationsNeeds
Takingthe
time
to
look
inside
the
virtual
machine
to
analyze
the
memory
that
an
application
uses
can
yieldagreatdealofinformationastothatVMsmemoryneeds.WhenevaluatingaWindowsoperating
system,ResourceMonitorandPerformanceMonitorcanberuntoexposewhichprocessesusememory
andhowmuchmemorytheyuse.Inaddition,consultingtheapplicationsbusinessownerhelps
determineotherpertinentinformation,includingwhenthisapplicationisused,whousesit,whatwould
happenifitwereunavailable,andhowtheuseoftheapplicationisgrowing.
Bytakingtimetounderstandthesefactors,VMadministratorscandrawfurtherinsightsintoproperly
sizingmemoryfortheVM,configuringresourcecontrols(ifneeded),andunderstandingthepriorityor
relativeimportanceoftheapplicationcomparedtoothers.
InstitutingaVMMemorySizingProcessNotonlyisavirtualenvironmentitselfdynamic,theusageoftheindividualapplicationsintheVMswill
alsobeinaconstantstateofflux.AsaVMwareadministratorworkingonacriticalproductionvirtual
infrastructurewithhundredsorthousandsofconstantlychangingvirtualmachines,theremustbea
formalprocessformemorysizingotherthanjusta"ruleofthumb"ortrialanderror.Thisprocess,
ideally,willinvolvetheapplicationadministratorsandwillbeundertakenbothwhenanewVMisbeing
createdforanapplicationandonaperiodicbasis.
Theworkflowdiagrambelowintroducesabestpracticeforhowtoexecutesuchaprocess.Whilethis
processmay
require
slight
modification
in
certain
situations,
it
will
work
as
is
for
most
VMware
administrators.ThenextsectionsfollowtheinitialNopath(notanewlydeployedVM)intheprocess
stepbystep,followedbycoverageoftheYespath.
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 9
-
8/2/2019 Vm Memory Vram Sizing Considerations
11/17
Figure6TheVMMemorySizingWorkflow
DeterminingTime
Frame
for
Analysis
ItisratherobviousthatmemorysizingforaVMmustbedonewhenthevirtualmachineisfirstcreated,
butwhataboutatothertimesthroughoutitsuse?Wastingexpensiveserverresources,especially
memory,onoversizedvirtualmachinesdecreasesROIandmayacceleratetheneedtopurchase
additionalhardware.Ontheotherhand,slowperformingapplicationscausedbyundersizedVMswill
leadtoendusercomplaintsandcanaffectabusinessbottomline.Additionally,applicationusagecan
varydramaticallyoverthecourseofaday,weekormonth,makingitnecessarytoallocateforthepeak.
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 10
-
8/2/2019 Vm Memory Vram Sizing Considerations
12/17
Frequentmemorysizingis,therefore,necessarybeyondanannualreview,orworse,leavingamemory
allocationasisfromthetimeofaVMscreation!
Herearethreetipsforperiodicmemorysizing:
UseRecentData Makesurethatthemostrecentmemorystatisticsarebeingused,aslastyear's
(or
even
last
months)
usage
may
no
longer
be
valid.
ChooseaTimeFrameThatCapturesPeakUsage MakesurethattheVMmemoryconfigurationvalueselectedcapturesthetimeofpeakusagethatwilloccurduringadesignated
timeperiodforthatapplication.Forexample,useadayforavirusscannerthatperformsadaily
scan,andamonthforanaccountingapplicationthatclosesthebookseverymonth.
ControlforSeasonality Forsomeorganizations,suchasuniversitiesorretailers,seasonalitymustbetakenintoaccountasdemandforresourceswillpeakduringstudentregistrationor
duringtheholidayshoppingseason,respectively.
FindingthePeakValue
Thisis
one
of
the
most
challenging
aspects
of
the
analysis.
Determining
aVMs
peak
memory
usage
cannotbereliablyaccomplished100%ofthetimeusingVMwaresmetricsalone. Thememoryactive
metricisanestimatedvalue,andevenwhenmeasuredatapeak,onlyindicatesthelevelofpage
activity. Itis,therefore,asignificantunderestimationofwhatavirtualmachinesmemoryneedsmay
actuallybe. Thememoryconsumedmetric, bycontrast,couldpotentiallybemorehelpful,butinmost
modernvirtualdeploymentsitoftenproducesthesamevalueasthememorygrantedmetric,resulting
inlittleornohelpfulinsight. Whetherduetolargememorypagesskewingthesemetrics,oragreedy
guestOSand/orapplication(s),memoryutilizationoftenrisestoabove95%nearlyallofthetime,and
increasingaVMsmemoryallocationwillnotdecreasethepercentageutilization.
Sowhat
peak
value
does
avirtualization
administrator
choose?
This
is
an
on
going
issue
for
VM
administratorseverywhere,andtheanswerisneverthesameinallcases. LookinginsidetheguestOS
canpotentiallygivedeeperinsight,butonlyifindividualprocessesaremonitored,andonlyiftheOS
deliversmetricsthatdistinguishbetweenwired,active,free,swap,etc. Sincepresentlythereisnoeasy
waytodothiswiththemetricsavailableinvCenteralone,performingthisassessmentatscalecan
becomequitechallenging. Untilmoremeaningfulmetricsareavailable,orVMwareToolsgaindeeper
OSmemoryinformation,determiningthepeakmemoryusageperVMwilllikelycontinuetobemoreof
anartthanascience.
Forthetimebeing,agoodpracticeistoexaminepeakmemoryconsumed. Ifthatvalueseems
abnormally
high
and
grows
equally
with
the
allocation
of
additional
memory,
then
check
within
the
OS
foranyactivediskswapping(independentlyofESXswapping).Ifnoneexists,thememoryconsumed
metricisnotveryinformative,andOSlevelanalysiswillberequired.
ComparingthePeakUsageValuetoAllocatedMemory
Thetruepeakvalueobservedshouldthenbecomparedtothememoryconfiguredforthevirtual
machine.Theprocessshouldtobe:
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 11
-
8/2/2019 Vm Memory Vram Sizing Considerations
13/17
Takeapercentofthememoryusageatthepeakvs.allocated
Iflessthan75%,thenchangeslikelyneedtobemade
Ifgreaterthan75%,thenstartevaluatingapplicationgrowth
Forexample,iftheVMisconfiguredfor8GBand,basedonanalysis,thetypicalmemoryactiveforthat
VMis
around
4GB
(even
taking
long
term
peaks
into
account),
then
50%
memory
utilization
of
the
allocatedmemoryisthepeakvalue.Withthatratio,itislikelythatchangesneedtobemadetothe
configuration.However,additionalanalysismaybeneededtodetermineexactlywhattheallocation
shouldbeasdetailedinthestepsbelow.
ForecastingUsageChangesuntilNextMemoryVMAllocationReview
BeforedecidingtodownsizeaVM'smemoryconfiguration,itisimportanttoconsiderthefactthatthe
memorydemandsoftheVM(and,morespecifically,itsapplication)couldincreasebetweennowand
thenexttimethememorysizingprocessisconducted.
Hastheapplicationownerbeencontacted?Wasanincreasingtrendinmemorydemandnotedbasedon
historicalanalysis?Itisimportanttoensurethatsufficientmemoryisprovisionedforbothcurrentusage
andestimatedusagegrowth,oraVMcouldfacememoryrelatedperformanceissues.
FactorinaBufferValue
Besidesfactoringinanexpectedgrowthrate,addingabufferisimportanttoensurethatthememory
allocationissufficient.Whilehistoricalpeakshavelikelybeentakenintoaccount,itisstillagood
practicetofactorinabuffertoensurethatthevirtualmachine'smemoryhassomeheadroomtoavoid
problems.Forlesscriticalapplications,abuffermaynotbenecessary,andcanbeavoidedtopreserve
morememoryformoreimportantapplications.Forthemorecriticalapplicationsthatdohavedynamic
memoryrequirements,addinga25%additionalbufferontheamountofmemoryallocatedfortheVMis
recommended.Thisway,intheeventthatanunexpected,businesscriticaldemandisplacedon
memory,theadditionalmemoryisavailabletofulfillthatneed.
ItisimportanttokeepinmindthatcertainVMwarefeatures,suchastransparentpagesharingand
ballooning,helptooptimizememoryusagewithinapplicationsandclaimmemorywhenabsolutely
necessary.Thus,thereissomeleewayindeterminingwhattheallocationshouldbetobalancebetween
notwastingmemoryandnotunderprovisioningacriticalVM.
ChangetheVMSizingAllocationandDocumenttheChange
Nowthatthetimeframeforanalysishasbeendetermined,peakutilizationhasbeendeterminedand
comparedto
the
allocated
amount,
and
an
estimate
of
future
memory
usage
has
been
made,
it
is
time
totakeaction:adjustorrightsizethevirtualmachine'smemorysizing.
UnlessthecorrectguestOSisinstalledandmemoryhotaddisenabled(assumingthememory
allocationneedstobeincreased),theguestOSmustbeshutdowntoaddorremovememoryfroma
virtualmachine.
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 12
-
8/2/2019 Vm Memory Vram Sizing Considerations
14/17
OncetheguestOSisshutdown,avirtualmachine'smemorycanberesizedbyrightclickingontheVM
(inthehostsandclustersinventory)andclickingonProperties.Atthatpoint,thewindowbelowappears
(seeFigure7)wherememorycanberesizedontheHardwaretab.
Figure7 ConfiguringMemoryonavSphereVM
OncetheVM'smemoryisresized,andtheVMispoweredbackon,thischangeshouldbedocumented
(alwaysagoodpractice!).
SettingUpaRegularMemoryReviewBasedonanAppropriateTimeframe
Becauseapplicationusagechanges,memoryallocationsmustbecontinuouslyevaluatedtoensurethat
performancewillnotbeimpactedduetoadditionalchangesinthedynamicvirtualizedinfrastructure.A
regularmemoryreviewprocessshould,thereforebesetatappropriateintervals.Therecommendation
hereisthatthisprocessoccuratleastoncepermonth;environmentsthataregrowingquicklymaywant
todothismorefrequently.Oncearightsizingprocesshasbeenconductedafewtimesonthevirtual
machinesinanyenvironment,thestepswillbecomemorefamiliarandadministratorscanthenbuildon
thisexperiencetostreamlinetheprocess.
ProvisioningaNewVMforAppropriateMemoryAllocationsThissectionbeginsthestepbystepcoverageoftheYespath(provisioninganewlydeployedVM)in
thememorysizingworkflowinFigure6.Theremaynotbeanyhistoricalperformancedataforanew
virtualmachine,unlesstheapplicationisverysimilartoanexistingVM.Forthisreason,thememory
configurationmadeforanewVMislikelytobemuchlessaccurate,andtheVMwillneedtobe
monitoredmuchmoreclosely.Still,followingthesizingprocedureoutlinedbelowwithfrequent
monitoringimmediatelyaftertheVMiscreatedwillprovidethenecessaryinsightstosizethememory
ofthatVMasaccuratelyaspossible.
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 13
-
8/2/2019 Vm Memory Vram Sizing Considerations
15/17
InitiallyAllocatetheMinimumPossible
Inmanycases,therewillbesomeideaofwhatthememoryallocationforanewVMshouldbe.Perhaps
othersimilarVMsexistintheenvironment,oranotheradministratorwhohasrunthatapplicationina
virtualinfrastructurecanprovidelessonslearned.Evenifthisinformationisbothavailableand
dependable,theprocessofmonitoringandreviewingdescribedbelowshouldstillbefollowed.
WhencreatingabrandnewVMforanapplicationthathasnotbeenpreviouslydeployed,andthereis
noindicationaboutwhatthememoryallocationshouldbe,vSpherewillmakeamemory
recommendationwhentheVMiscreated,basedontheguestOSspecified.ThisisavailableinFigure7
above,whereitsays"MinimumrecommendedforthisguestOSis:512MB".Here,intheabsenceof
informationtothecontrary,anadministratormayaswellaccepttakethedefaultmemoryconfiguration
fortheguestOS.
Whileitmaybetemptingtogowitha"gutfeel"orusethesameamountofRAMthatphysicalservers
areconfiguredwith(e.g.justuse4GBor8GB),it'slikelythattheallocationmaybeoverallocatingthe
amount
of
memory
actually
required
owing
to
the
vSphere
memory
conservation
techniques
mentioned
above.
HerearethreeadditionalreasonsforprovisioningnewVMswithasmallermemoryallocationinitially:
Itistechnicallyeasiertoaddmemorythantotakeitaway Withcertainguestoperatingsystems,ifmemoryhotaddisenabled,RAMcanbehotadded(butthereisneveranoptionto
"hotremoveRAM).
TheOSandhypervisorwilloftenprovidedifferentmemoryusagedataTheOScanonlyreportonitsusageofthememorythatthehypervisorisproviding.Thismeansthatthememory
usagerateswilloftenbedifferentforthehypervisorandtheOS.Thesedifferencesmakeit
difficultto
pinpoint
exactly
how
much
memory
is
needed,
however,
and
can
cause
application
ownerstobecomeoverlyconcernedthereareinsufficientresourcestomaintainperformance.
Byslowlyaddingmemoryafterbeginningwithaminimalallocation,itwillbeeasiertoassess
theimpactsofchangestoreachtheoptimalamount.
Applicationownerconcerns,PartIIApplicationownersmaybecomeuneasyifmemoryisbeingtakenawayfromanapplication,therebymakingitmoredifficulttoremovethememory,
evenifthedatashowthattheallocationiscurrentlyoverprovisioned.
MonitorMemoryMetricsIntensely
OnceanewVMsmemoryhasbeenallocated,thatmemoryusageshouldbemonitoredintensely.Just
howfrequent
and
in
depth
this
monitoring
should
be
depends
on
the
criticality
of
the
VM.
AdministratorsmayalsowanttousevSpherealarmstoalertthemastoifandwhenanewVMis
runninglowonmemory.Whenmonitoring,lookbothatthevSphereVMmemorylevelandinsidethe
guestOStoseehowmuchmemoryisbeingutilized.IstheVMmaxingouttheminimumamountof
memoryconfigured?Ifso,thenmorememoryisneeded.
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 14
-
8/2/2019 Vm Memory Vram Sizing Considerations
16/17
AddMoreMemoryinSmallIncrements
IfthenewVMisrunninglowonmemory,morememoryshouldbeaddedinsmallincrements.
Remember,memoryisnormallythemostconstrainedresourceaserverhas.AddingoneormoreGBof
RAMonaVMmaybewastefulandunnecessary.Whenmorememoryisneeded,itisbettertouse
incrementsof256MBor512MB.
AddtheNewVMtotheRegularMemorySizingReviewProcess
EverynewVMshouldbeincludedintheperiodicmemoryreviewprocess(discussedabove)afterthe
memoryusagehasbeeninitiallystabilizedwithanappropriatememoryallocation.
ConclusionMemoryistypicallythemostconstrainedcomputingresourceinavirtualizeddatacenter.Byleveraging
theinformationpresentedinthiswhitepaperandimplementingtheworkflowdetailedabove,
virtualizationadministratorscanmoreefficientlyusethisprecious(andcostly)computingresource.
Rightsizingmemory
allocations
makes
more
memory
available
for
other
VMs,
resulting
in
increased
VM
densityanddeferredpurchasesofhardware.Additionally,regularmonitoringofmemoryusageenables
VMadministratorstoproactivelydetectproblemareasinVMsthatareunderprovisionedtoavoid
performanceissues.Ultimately,accuratelysizingmemoryinvirtualmachinesresultsinabetterreturn
oninvestmentforanyvirtualizationinitiative,andapplicationownershavegreaterconfidenceinthe
performancethatvirtualizationprovidestheirapplications.
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 15
-
8/2/2019 Vm Memory Vram Sizing Considerations
17/17
AbouttheAuthor
DavidDavis is the author of the bestselling VMware vSphere video training library from
Train Signal. He has written hundreds of virtualization
articles on the Web, is a vExpert, VCP, VCAPDCA, and CCIE
#9369 with more than 18 years of enterprise IT experience.His personal Website is VMwareVideos.com.
AbouttheSponsor
VKernel is the number one provider of performance and capacity management products for
virtualized data centers and cloud environments. The companys awardwinning, easy touse and powerful products simplify the complex and critical tasks of realtime VMware
performance monitoring, capacity planning, resource optimization, reporting and
chargeback for virtual environments. Used by over 50,000 virtualization administrators,
VKernels products have proven their ability to immediately identify and resolve VM
performance problems, maximize capacity utilization, and reduce virtualization costs.
2011 VKernel Corporation. All rights reserved. http://www.vkernel.com 16
http://www.trainsignal.com/VMware-Training.aspxhttp://www.vmwarevideos.com/http://www.vmwarevideos.com/http://www.trainsignal.com/VMware-Training.aspx