VMWare Suspend/Resume Disk Thrashing Hell

Filed under: VMWare — lars @ 08:11:18 am
I've finally managed to fix a problem I had with VmWare. I've been running VmWare Server (1.04) on a DualCore WinXP machine with 3gb of RAM where I need to frequently switch between Virtual Machines by suspending one and then resuming another. When I did this, my hard-drive would just churn constantly for 10-20+ minutes during which my VM would be unusable. My guest VMs only required 2gb of RAM and I never ran more than one at the same time - so I had plenty of RAM to spare. But it would take ages before the VM became responsive.

I tried all the following config settings:
  • Guest VM page-size set to 256mb to keep swap use at a minimum
  • Host VM page-size set to 320mb to keep swap use at a minimum
  • Host Reserved Memory set to 2100MB (In Host Settings -> Memory) so there's enough for my VM
  • Host configured to 'Fit all virtual machine memory into reserved host RAM' (In Host Settings -> Memory)
  • Host has 'Take and restore snaptops in the background' disabled (In Host Settings -> Priority)
  • VMs all have Snapshots disabled.

When I resumed a VM, I could see the vmware-vmx.exe memory usage climb, then fall again once the guest has finished resuming, so it looked like all the required memory was being allocated up front like it should. So what's with the disk thrashing?? I don't care how long the resume takes, but I want to know my VM is ready to go when it's done!

Then I found this forum thread: http://www.911cd.net/forums//lofiversion/index.php?t15849.html

Based on it's recommendations, I manually added the following lines to my .vmx config files:

prefvmx.useRecommendedLockedMemSize = "TRUE"
prefvmx.minVmMemPct = "100"
mainMem.partialLazySave = "FALSE"
mainMem.partialLazyRestore = "FALSE"
mainMem.useNamedFile = "FALSE"

(The post additionally recommended this setting, which I already had)

sched.mem.pshare.enable = "FALSE"


After adding these, resume seems to take quite a bit longer, but there appears to be no disk thrashing/swapping/lag after the resume is complete.

Problem solved! :)

As a bonus, now the Windows Task manager memory graph (under the Performance tab) on my host machine actually includes the physical memory allocated to the VM, so I have a much better idea of whether or not I am running out of RAM on my host or not.


Edit 19 Apr 2010

I just stumbled across this page: http://www.virtualization.info/2005/11/how-to-improve-disk-io-performances.html - which recommends adding this line to your .vmx file:

MemTrimRate=0

This disables VmWare checks to de-allocate parts of memory that the guest isn't using, which is an overhead on memory allocations by the guest.

Comments

No Comments for this post yet...

    Leave a comment

    Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>


    Options:
    (Line breaks become <br />)
    (Set cookies for name, email & url)




    powered by  b2evolution