+ Reply to Thread
Results 1 to 7 of 7
  1. Senior Member
    Join Date
    Nov 2007
    Location
    NYC
    Posts
    441

    Certifications
    BS in IT:NDM, VCPv5, VCPv4, MCITP: SA, MCSE 2003:S, MCSA 2003:M, MCTS 70-351, 70-652, CCENT, CCNA, CCNA: Security; Network+, A+, WIP: RHCSA
    #1

    Default (VMware) Will a guest VM swap when RAM usage is high even though Active is not?

    We are currently having a discussion in my environment. The assumptions are that

    “The tools that are designed for a physical infrastructure memory management in Linux such as top, free, vmstat, /proc/meminfo don’t work on a VM in an ESXi hypervisor because they rely on the OS’s ability to monitor the physical RAM directly in a bare metal system. In a virtual infrastructure, the guest OS can't see the physical hardware, only the virtual hardware that has been emulated by the (ESXi) hypervisor. Because an OS can't directly access most of the host server's physical hardware, traditional performance monitoring tools won't function properly in a virtual infrastructure.”
    In the VM guest (SLES 11) we’re seeing RAM utilization at around 93%. However in the vSphere/vCops is showing 5072309 kb Active Write of 8388608 (8GB) KB of allocated RAM. Roughly about 60.46 % utilization rate.

    The question, is the above assumption correct and if so:

    If top inside the guest is inaccurate in the VM and it reaches 100% RAM utilization does the VM guest then swap and if so I presume with the vswp which is located on the SAN and cause a slowdown on the VM Guest?
    Last edited by pwjohnston; 08-01-2014 at 03:10 PM. Reason: vmware, ram, vswp
    Reply With Quote Quote  

  2. SS -->
  3. Google Ninja jibbajabba's Avatar
    Join Date
    Jun 2008
    Location
    Ninja Cave
    Posts
    4,240

    Certifications
    TechExam Certified Alien Abduction Professional
    #2
    First: Yes, things like "top" in Linux or the "taskmanager" in Windows can be false in a virtual environment.

    The guest OS doesn't "know" visualization features such as Transparent Page Sharing, Ballooning, Compression and last but not least, swapping.

    The whole point in virtualisation is of course overcomittment, so you don't waste allocated resources. Say a VM is assigned 8GB of RAM but uses only half that. The remaining 4GB of RAM can be allocated to other VMs needing it. Now assume the VM uses 100% of memory - all 8GB of RAM - for a while. Now you got two of those VMs using the same page in memory, VMware effectively gets rid of one copy, freeing up some memory (somewhat like deduplication).

    The Guest OS would not know anything about it, still thinking it needs 100% ..

    I am so bad in explaining things like that - I hope it makes vaguely sense

    If all those features are exhausted, the last step is indeed swapping, that is where it goes really dirty and poor. Because of this actually you NEED to monitor the performance from VMware point of view - which you do with vcops anyway.

    As for OS swap - if the OS thinks you are out of RAM, it will indeed swap. Therefore a lot of people would put the virtual machine swap on separate datastores for example.

    In fact, a lot of times people even disable swap in Linux / Pagefile in Windows when they are VMs. Most providers I worked with won't allow swap because of the risk of disk performance issues.
    Reply With Quote Quote  

  4. Senior Member
    Join Date
    Nov 2007
    Location
    NYC
    Posts
    441

    Certifications
    BS in IT:NDM, VCPv5, VCPv4, MCITP: SA, MCSE 2003:S, MCSA 2003:M, MCTS 70-351, 70-652, CCENT, CCNA, CCNA: Security; Network+, A+, WIP: RHCSA
    #3
    Quote Originally Posted by jibbajabba View Post
    As for OS swap - if the OS thinks you are out of RAM, it will indeed swap. Therefore a lot of people would put the virtual machine swap on separate datastores for example.
    This is actually not a bad idea. Maybe I can get them spring for some RAMdisks to put in the SAN.

    Quote Originally Posted by jibbajabba View Post
    In fact, a lot of times people even disable swap in Linux / Pagefile in Windows when they are VMs. Most providers I worked with won't allow swap because of the risk of disk performance issues.
    Is that even safe? If the guest doesn't think it has RAM or SWAP to work with won't it crash?
    Reply With Quote Quote  

  5. Senior Member scott28tt's Avatar
    Join Date
    Jul 2010
    Posts
    602

    Certifications
    MCSE VCP2 VCP3 VCP4 VCP5 VCAP4-DCA VCI
    #4
    Quote Originally Posted by pwjohnston View Post

    If top inside the guest is inaccurate in the VM and it reaches 100% RAM utilization does the VM guest then swap and if so I presume with the vswp which is located on the SAN and cause a slowdown on the VM Guest?
    The guest OS has no awareness of the vswp file - that file belongs to ESXi if it needs to swap memory at the host level (where an overcommitted host begins to run out of physical RAM). If it needs to, the guest OS will swap to the same place as it would do if it were running on a physical system - to the swap partition or file configured as part of the OS installation, this will sit inside one of the vmdk files of the VM.
    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
    Reply With Quote Quote  

  6. Not IT n00b dave330i's Avatar
    Join Date
    May 2011
    Location
    NoVA
    Posts
    1,948

    Certifications
    VCIX-NV, VCAP5-DCD/DCA, VCAP-CID/DTD, VCP4, Security+, MCTS-640, EMCISA, ITILv3 Foundation
    #5
    Quote Originally Posted by pwjohnston View Post
    This is actually not a bad idea. Maybe I can get them spring for some RAMdisks to put in the SAN
    Setting aside SSD for vswap dir is an inefficient use of resources. You get better performance using the SSD as read/write cache.
    2017 Certification Goals: Fun filled world of AWS
    "Simplify, then add lightness" -Colin Chapman
    Reply With Quote Quote  

  7. Senior Member
    Join Date
    Nov 2012
    Location
    Montreal
    Posts
    589

    Certifications
    OSCP, CEH, SSCP, EJPT, CCNA:Security, CCNA:R&S, MCSA:W2K8, Linux+, LPIC-1, SCLA
    #6
    This kind of topic is the reason why I just love this forum, you get to learn so much just reading experienced people's posts.

    Reply With Quote Quote  

  8. 1337sauce
    Join Date
    Jul 2011
    Location
    Ze South
    Posts
    1,539

    Certifications
    BS, Linux+, Security+, LPIC-1, MCSE Server 2012, MCSE Desktop, MCSA Server 2008, MCTS 70-[415,681], MCTS 74-409, VCA-DCV, Novell CLA/DCTS/CNS, HDI CSR
    #7
    On the Hyper-V side of things...same deal, guest OS has no idea of the underpinnings related to the host OS/hardware. This makes things interesting with dynamic memory allocation because the only "true view" is running perfmon from the host but it does allow you to maximize RAM usage (as long as you plan and adjust properly!).

    Also regarding the page file for Windows VM's--rule of thumb in my shop is add a separate disk and move the page file there, however retain 512mb on C:\ for crashdumps. With the pagefile on a separate disk, it can be excluded from things like backup and WAN replication.
    Reply With Quote Quote  

+ Reply to Thread

Social Networking & Bookmarks