Options

Question on VM performance

EssendonEssendon Member Posts: 4,546 ■■■■■■■■■■
This thing has me going in circles so much that after reading for a while I'm as confused as a blonde looking for a corner in a round room.

I have this VM with configured memory of 256MB (with NO reservation), runs Windows Server 2003. Please take a look at this screenshot:



Things were cruising along till at 12.24pm I set a limit of 75MB memory on the VM. I simulated contention by doing something within the VM and bam the graph changes dramatically. Lemme analyse and explain the graph and you correct me where I'm wrong, right?

Granted: This is the memory that's configured on the VM, so 256MB and it's all good till 12.24pm. Why did this fall when contention occurred? I can also see that it fell by the same amount that the Ballooned memory went up by. I realize the VMkernel reclaims memory via ballooning when there's contention, but why did the Granted memory fall? Does it mean that the kernel ballooned to the memory that was configured for it?

Consumed: From what I've been reading in Duncan Epping's deepdive book, this is the maximum amount of memory that Windows used. Even after Windows doesnt need the memory anymore, the kernel doesnt know that the pages are obsolete and hence why I have had a constant graph till 12.24pm. Why was there a dip during the time contention occurred? I know that the guest OS has no knowledge of the limit, but then isnt this metric at the hypervisor level, not the VM level? If this is the case, why didnt it dip to 75MB right when contention occurred?
After contention ended and I removed the limit, it suddenly shot up to 225MB. I understand why it did but why didnt it stay at 225MB, I thought the hypervisor didnt know that pages were now obsolete?

Active: Why doesnt the difference between active and consumed remain the same at all times? I understand that active is what's currently in use by the guest, but how did the Active figure go beyond the 75MB that's the configured limit on the VM?

Thank you in advance for reading and responding. Some of these graphs and terms are just plain crazy. Put me out of my misery please!
NSX, NSX, more NSX..

Blog >> http://virtual10.com

Comments

  • Options
    dave330idave330i Member Posts: 2,091 ■■■■■■■■■■
    Essendon wrote: »
    Granted: This is the memory that's configured on the VM, so 256MB and it's all good till 12.24pm. Why did this fall when contention occurred? I can also see that it fell by the same amount that the Ballooned memory went up by. I realize the VMkernel reclaims memory via ballooning when there's contention, but why did the Granted memory fall? Does it mean that the kernel ballooned to the memory that was configured for it?

    Granted is the amount of memory hypervisor allocates to the VM. During contention, only the reserved resource is guaranteed, so granted plummets.
    Essendon wrote: »
    Consumed: From what I've been reading in Duncan Epping's deepdive book, this is the maximum amount of memory that Windows used. Even after Windows doesnt need the memory anymore, the kernel doesnt know that the pages are obsolete and hence why I have had a constant graph till 12.24pm. Why was there a dip during the time contention occurred? I know that the guest OS has no knowledge of the limit, but then isnt this metric at the hypervisor level, not the VM level? If this is the case, why didnt it dip to 75MB right when contention occurred?
    After contention ended and I removed the limit, it suddenly shot up to 225MB. I understand why it did but why didnt it stay at 225MB, I thought the hypervisor didnt know that pages were now obsolete?

    Since you set a limit, the amount of physical RAM consumed by the VM is 75MB + overhead.
    Essendon wrote: »
    Active: Why doesnt the difference between active and consumed remain the same at all times? I understand that active is what's currently in use by the guest, but how did the Active figure go beyond the 75MB that's the configured limit on the VM?

    Looking at the graph, it looks like active memory went above 75MB after you removed the limit.
    2018 Certification Goals: Maybe VMware Sales Cert
    "Simplify, then add lightness" -Colin Chapman
  • Options
    EssendonEssendon Member Posts: 4,546 ■■■■■■■■■■
    Thanks for the reply Dave, makes sense. Things are falling into place now thankfully!

    Just another question, repeating it basically - After contention ended and I removed the limit, it suddenly shot up to 225MB. I understand why it did but why didnt it stay at 225MB, I thought the hypervisor didnt know that pages were now obsolete?
    NSX, NSX, more NSX..

    Blog >> http://virtual10.com
  • Options
    blargoeblargoe Member Posts: 4,174 ■■■■■■■■■□
    Essendon wrote: »
    Thanks for the reply Dave, makes sense. Things are falling into place now thankfully!

    Just another question, repeating it basically - After contention ended and I removed the limit, it suddenly shot up to 225MB. I understand why it did but why didnt it stay at 225MB, I thought the hypervisor didnt know that pages were now obsolete?

    "Consumed" memory is the amount of physical memory consumed by the VM, from the perspective of the hyper visor. When you limit the VM to 75MB, the hypervisor sees 75MB of physical memory consumed, and the rest swapped out or ballooned. You can add the graphs to the memory performance chart for memory balloon and memory swapped to see this.
    IT guy since 12/00

    Recent: 11/2019 - RHCSA (RHEL 7); 2/2019 - Updated VCP to 6.5 (just a few days before VMware discontinued the re-cert policy...)
    Working on: RHCE/Ansible
    Future: Probably continued Red Hat Immersion, Possibly VCAP Design, or maybe a completely different path. Depends on job demands...
  • Options
    EssendonEssendon Member Posts: 4,546 ■■■■■■■■■■
    Thank you for the reply gents. Here's another question, correct me where I'm wrong please.

    Say there's a resource pool with 4GB RAM (with reservations for VM's created at this level) and there are two VM's in the pool sharing resources. VM1 is configured with 3GB RAM with a 2GB reservation and VM2 is configured with 2GB with a 1GB reservation.

    At t=0s, both VM's are running just fine with no contention.
    At t=1s, say VM1 suddenly needs all the RAM it's configured with. So the balloon driver on VM2 inflates to counter the contention. So at this time, the total memory used is more than what's available.
    At t=2s, say VM1 doesnt need the memory anymore. Does the memory flow back to the resource pool?
    At t=3s, VM2 needs all the RAM configured on it. Will the balloon driver kick in and balloon 1GB or will VM2 get the memory from the resource pool and balloon nothing at all?

    Thanks.
    NSX, NSX, more NSX..

    Blog >> http://virtual10.com
  • Options
    dave330idave330i Member Posts: 2,091 ■■■■■■■■■■
    I assume you're talking about non-expandable RP (generally you should set your RP to be expandable). Unless you've set shares to each VM, each VM is treated equally. When there's resource contention, both VMs are affected.
    2018 Certification Goals: Maybe VMware Sales Cert
    "Simplify, then add lightness" -Colin Chapman
  • Options
    scott28ttscott28tt Member Posts: 686 ■■■■■□□□□□
    What do you mean by the resource pool having 4GB - a reservation, a limit, both? I'm assuming a limit below.

    At t=1s, the two VMs will be guaranteed their reserved amount of memory and the unreserved memory they are requesting will be competed for using shares - memory shares by default are 10 per MB of allocated memory so the likelihood is that VM1 would be allocated more memory than VM2 - that's the theory. The memory previously claimed will also be considered as will the memory idle tax which is based on activity within previously claimed memory, so in fact it's difficult to say what would actually happen.

    If the 4GB for the resource pool was a reservation and there was no limit on the VMs or the resource pool then both VMs could still be under no contention at all depending on the memory at the parent level of the resource pool.
    VCP2 / VCP3 / VCP4 / VCP5 / VCAP4-DCA / VCI / vExpert 2010-2012
    Blog - http://vmwaretraining.blogspot.com
    Twitter - http://twitter.com/vmtraining
    Email - vmtraining.blog@gmail.com
  • Options
    scott28ttscott28tt Member Posts: 686 ■■■■■□□□□□
    dave330i wrote: »
    Unless you've set shares to each VM, each VM is treated equally.

    That is only true by default when the VMs have the same memory allocation, as memory shares default to 10 per MB of allocated memory, so in the example given VM1 would have 30720 memory shares and VM2 would have 20480 by default - they won't be treated equally if there's contention.
    VCP2 / VCP3 / VCP4 / VCP5 / VCAP4-DCA / VCI / vExpert 2010-2012
    Blog - http://vmwaretraining.blogspot.com
    Twitter - http://twitter.com/vmtraining
    Email - vmtraining.blog@gmail.com
Sign In or Register to comment.