VMware Cloud Community
tomtom1
Enthusiast
Enthusiast
Jump to solution

Memory required Physical server Vs Virtual Machine

Is there a white paper explaining why we we need less memory in Virtual Machine as compared to Physical Machine.

The problem here is my boss wants to know why it is so. It is very difficult for me to explain him this reason, he wants to see a white paper OR some article on the internet.

As a VM admin, I know we can add and remove the memory to a VM but it won't be that easy when we talk about Physical servers. I suggested him that we should follow a standard and if there is a business requirement we can increase/decrease is as needed. Now when the vendor comes in they give us specs for Physical server and not the virtual and there is always a argument that why should VM be having 6-8 GB of memory upfront. So to avoid all that arguments he needs some other proof.

Thanks

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Rumple
Virtuoso
Virtuoso
Jump to solution

Here is a simple explaination of why VM's need less memory. Transparent Page sharing.

If you install a single VM of Windows 2008 SP2 Server, lets assume it uses 500MB of RAM while sitting idle. thats basically all the running components loaded into memory.

If you then power up an Identical VM, the new VM will not re-load the exact same components into memory. ESX will see that the exact same memory block has been loaded into the Host memory (phyiscal hardware) from Server1 and then just point the VM at the already existing component loaded into memory.

Once the VM has loaded and TPS has kicked in, you will probably find that for 2 identical VM's you are not only using 650MB of memory (not 1000MB as expected). thats because for 80% of the components the new VM needs, it just uses the existing memory blocks, instead of duplicating them.

Now, repeat this over 10 VM's and lets assume only 50% of the memory is identical between them...thats still a huge memory savings. In this case, since each Windows VM is really only loading 250MB of itself into memory and sharing the rest, technically you don't need to allocate 2GB of RAM to each VM...you can easily get away with putting 1-1.5GB on that server and still have the same ratio of free memory for programs as you would if it was a physical server.

View solution in original post

0 Kudos
12 Replies
RaymondG
Enthusiast
Enthusiast
Jump to solution

I would tell him that the Requirements are the same to save time. Since the VM will only use what it needs, unless given a reserve, it wont matter how much ram you allocate to it once it is already started.....(the memory overhead will be slightly higher though). For these reasons, I would not argue about memory... I'd just give em what they ask for until they are all warm and comfy about VM.

Raymond Golden

VCP3, VCP4, MCSA, A, Net, SEC+

Raymond Golden VCP3, VCP4, MCSA, A+, Net+, SEC+
0 Kudos
schepp
Leadership
Leadership
Jump to solution

The ressource management guide contains a few sites explaining shared memory, maybe that is useful. The whole document is around 120 sites long, so cut out the important stuff Smiley Happy

http://www.vmware.com/pdf/vsphere4/r40_u1/vsp_40_u1_resource_mgmt.pdf

0 Kudos
tomtom1
Enthusiast
Enthusiast
Jump to solution

No, that will not help me. I need to show it to management and they won't get into the technical part they want a article or a whitepaper to that affect.

thanks

0 Kudos
J1mbo
Virtuoso
Virtuoso
Jump to solution

I essentially agree with both the above - it is not that we need less memory for VMs, rather that physical servers are often overspecified in the first instance. The 8GB comment is a case in point, I wonder how many of those are also specified with 32-bit Windows....

When ESX is under memory stress (i.e. running out of physical RAM), it will switch to 4K pages allowing TPS to deduplicate some RAM, and the balloon drive (if tools are installed) will then recover unused RAM from VMs - but ultimately if there isn't enough physical RAM, OS level paging (balloon) or ESX level (vSwapping) will create tonnes of disk IO and seriously stiffle the overall performance.

Please award points to any useful answer.

0 Kudos
tomtom1
Enthusiast
Enthusiast
Jump to solution

Our servers have 128 GB memory each. They are very powerful servers. In our template we start with 2GB and if the need be, we increase it more.But now the problem is people who want to install new Application they get the specs from the vendor and they stick to it.

We have reporting tool to let us know the VM is running low on memory and it needs more.

The more I think about this, the more I feel it is more political rather than technical and it gets very difficult to deal with them in such situations.

0 Kudos
golddiggie
Champion
Champion
Jump to solution

I really wouldn't worry about it too much... The way VMware/ESX handles memory is different than they are probably used to thinking about server memory (as I'm sure you're aware of by now).

For example, on my ESXi host I have 16GB of physical RAM installed. Right now I have seven VM's running with a total allocation of 13GB (adding up what each has been granted in the settings). Of that, the actual memory usage is about 8-1/2GB.

If it makes your life easier, give the servers what the software actually requires, then increase it if there's evidence of it actually needing more. Set up the alerts for cases where the VM is using too high a percentage of it's allocated memory, for a reasonable amount of time. You can then address those servers as needed and not make people upset. With 128GB of RAM inside the host, you shouldn't have any trouble keeping the application admin's happy as well as continue to virtualize to move forward.

VCP4

0 Kudos
Rumple
Virtuoso
Virtuoso
Jump to solution

Here is a simple explaination of why VM's need less memory. Transparent Page sharing.

If you install a single VM of Windows 2008 SP2 Server, lets assume it uses 500MB of RAM while sitting idle. thats basically all the running components loaded into memory.

If you then power up an Identical VM, the new VM will not re-load the exact same components into memory. ESX will see that the exact same memory block has been loaded into the Host memory (phyiscal hardware) from Server1 and then just point the VM at the already existing component loaded into memory.

Once the VM has loaded and TPS has kicked in, you will probably find that for 2 identical VM's you are not only using 650MB of memory (not 1000MB as expected). thats because for 80% of the components the new VM needs, it just uses the existing memory blocks, instead of duplicating them.

Now, repeat this over 10 VM's and lets assume only 50% of the memory is identical between them...thats still a huge memory savings. In this case, since each Windows VM is really only loading 250MB of itself into memory and sharing the rest, technically you don't need to allocate 2GB of RAM to each VM...you can easily get away with putting 1-1.5GB on that server and still have the same ratio of free memory for programs as you would if it was a physical server.

0 Kudos
tomtom1
Enthusiast
Enthusiast
Jump to solution

Is there any diagram which shows the memory consumed by Physical and Virtual Server for the same type of application and how VM will consume less memory due to Memory savinf technique of ESX server ? I did some google searrh but did not find anything worth while.

Thanks

0 Kudos
Rumple
Virtuoso
Virtuoso
Jump to solution

there is nothing really out there to diagram it because it all depends on the configuration and applications.

If you have a Windows 2003 server and a Windows 2008 Server both different applications you will get very little memory sharing as they have different versions and types of files loaded into memory.

If you have a Windows 2003 server and a Windows 2008 server both running the same application (lets say Word 2007 Patched identically), then Word will probably be shared in memory, but not the operating systems.

There is no way to really tell what is going to happen, which is why you either need to have a monitoring/reporting application like veeam, or vfoglight to help you identify those servers that might be sharing alot of memory or too little memory.

In some cases, you can give 2 servers both 2GB of RAM and find out after a month of running that you've overallocated 1GB of ram on server1 and underallocated Server 2 by 2GB of RAM (ie, the application is using all the memory and needs more).

0 Kudos
tomtom1
Enthusiast
Enthusiast
Jump to solution

I respectfully dont agree with your comments that there is nothing out there to diagram. Think about it this way - Wont any sales guy from Vmware make a presentation that if you move to VI you will save on memory due to memory technique deployed by vmware ?

Thanks

0 Kudos
RaymondG
Enthusiast
Enthusiast
Jump to solution

I agree the VMware does make that point. But never did I hear that an Application that "requires" 5 gig on a physical server, will require less on a VM. They should both be the same. The memory advantages with VM has to do with it's ability to take back unused memory not memory the app has to use. Just my opinion....I could be wrong

Raymond Golden

VCP3, VCP4, MCSA, A, Net, SEC+

Raymond Golden VCP3, VCP4, MCSA, A+, Net+, SEC+
0 Kudos
Rumple
Virtuoso
Virtuoso
Jump to solution

Here are all kinds of reports and resources on consolidation (which is what this discussion falls into.)

http://www.vmware.com/solutions/consolidation/resources.html

I also agree that if the Application will use 5GB of RAM its going to need that in a VM space. the reality is that 99.5% of all application developers pull specs out of their ass and state..oh, its Windows 2008, plus its got SQL and a the application on it, we need minimum 4GB of RAM...when in reality, the application is using 1Gb of RAM, the SQL is using 1.5GB of RAM and because of the Transparent Page Sharing, Windows is using 400MB of RAM.

In this case, the Solution requires 3Gb of RAM to run. In a physical world, you have 1GB of RAM locked to that server that's not being used. In the virtual world, that 1GB of RAM can be used by other servers if they need it. Unless reservations are needed, CPU and memory are allocated out of the pool. If you have 20 copies of the same Solution that in the physical world would be allocated 4GB of RAM Each, in the Virtual world, you would create the 20 servers, give them 4GB of RAM and find out that out of 80 GB, there is still 30 GB of RAM freely available for other servers.

Now, you would not want to then re-allocate all 30GB to other servers, but you could probably safely allocate 15GB of that RAM to other servers with the assumption (based on experience) that no more than 5 VM's of the above solution would require their full 4GB of allocated RAM at any one time.

This is where the oversubscription comes into play...

0 Kudos