Thursday, August 16, 2012

Computers: VM Performance tuning

In my earlier blogs (such as Computers: Antivirus), I discussed other aspects of the care & feeding of your computer.  I originally wrote these tips specifically to tune Virtual Machines for VMWare server v7.5. However, if you ignore the VMWare specific settings and just perform the other actions, these instructions ought to work well to tune up any machine.

NOTE: that these specific directions are for WinXP systems, however, the general principals ought to apply to later Windows versions too.
  1. Host system prep
    1. Ensure the guest VM is not running!
    2. When possible, install VMs on internal, eSATA, or USB 3.0 capable external drives only.
    3. Ensure "Write caching" is enable on the hard drive on which the VM is installed (for internal drives this is the default setting)
    4. For external drives, ensure the "Better performance" radio button is selected in the Device Properties -> policy tab (this should already be selected)
    5. Remove unused files (recommend running ccleaner to do this)
    6. Defragment the OS (recommend running auslogics defrag on "Defrag and optimize" setting)
      1. Repeat as necessary until the defrags take less than 10 minutes to complete!
      2. WARNING: do not defragment the host hard drive while running a VM!
      3. NOTE: filesystems with multiple VMs can take many hours to defrag and optimize the first few times. Plan your defrags accordingly.
    7. Configure Win to perform weekly maintenance on your hard drive
      1. Run ccleaner on your hard drive at least once per week (contact me if you need instructions on how to do this.)
      2. Run defrag your hard drive at least once per week (contact me if you need instructions on how to do this.)
    8. Close applications and turn off services which use a lot of memory (such as web browsers) prior to launching your VM
      1. In Services, set "Indexing Service" to "Disabled"
    9. Create a fixed page file size of 1 – 2x your physical RAM (this is always a trade-off; using a larger value improves your run time performance BUT also permanently removes that space from your available drive space)
      1. Open Control Panel -> System -> Advanced -> Performance -> Settings -> Advanced -> Virtual Memory
      2. Click on [Change]
      3. Click the "Custom Size" radio button
      4. Enter the value "6192 or 12384" (for 6 GB RAM systems) or "8256 or 16512" (for 8 GB RAM systems) for "Initial size (MB)"
      5. Enter the value "6192 or 12384" (for 6 GB RAM systems) or "8256 or 16512" (for 8 GB RAM systems) for "Maximum size (MB)"
      6. Click on the [Set] button
      7. Click [OK] and [Close] to get all of the open windows closed
    10. Restart your host system before proceeding
  2. VM Workstation global settings (for VMWare workstation) –
    1. VM Workstation memory settings (Edit -> Preferences -> Memory – click the appropriate radio button)
      1. Otherwise set the VM workstation memory setting to "Allow some VM memory to be swapped"
    2. Set the amount of memory available for VMs with "Memory Allocated to Virtual Machines"
      1. Launch your normal set of host system applications
      2. Open your task manager -> Performance tab
      3. Check the values of "Physical Memory Usage" and "Total Physical Memory"
      4. Set the "Memory Allocated to Virtual Machines" to the lesser of
        1. The value found by (Total Physical Memory – Physical Memory Usage – 512 MB)
        2. 3684 MB
  3. VM Settings
    1. Set memory to a value of 100 MB smaller than the value found in 2.2.4
      1. NOTE: This value should be between 1.5 GB and 3.5 GB – see details below
        1. Add up the memory usage of the applications you intend to use in your VM – this should be the lowest value of memory usage you consider.
        2. 2 - 3.5 GB would be better if those values meet the other requirements
        3. NOTE: 32 bit OS (e.g. 32 bit WinXP VMs) cannot address more memory than 3584 MB (the exact amount is dependent upon your environment), so there is no reason to use a number larger than this.
    2. Set "CPU processors" to 1 processor
    3. Set "CPU cores per processor" to ½ of your cores rounded up (so not less than 1).
    4. Floppy drive – uncheck the "Connect at power on"
    5. Unset the CD/DVD drive auto-detect
    6. Disable/remove USB Controller
    7. Disable/remove printer
    8. Disable/remove soundcard
    9. When done only the following should appear under the "Devices" tab:
      1. Memory
      2. Processers
      3. Hard Disk
      4. CD/DVD – "Using drive [C|D|E]:"
      5. Floppy – Auto detect
      6. Network Adapter
      7. Display – Auto detect
  4. Guest system preparation
    1. Launch the VM (your VM must be running to make these changes)
    2. Start -> Control Panel -> System -> Hardware -> [Device manager]
      1. Disable Floppy drive
      2. Disable Com1
      3. Disable Com2
      4. Disable Lpt1
    3. Install latest version of VMTools – RMC on VMTools and click on the [Update] button
    4. Remove unused files (recommend running ccleaner to do this)
    5. Defragment the OS (recommend running auslogics defrag on "Defrag and optimize" setting) – repeat as necessary until the defrags take less than 10 minutes to complete!
    6. Shrink the VM – RMC on the VMTools and follow instructions on the VMTools SHRINK tab
    7. Create a fixed page file size of 1-2x the memory of your VM (the value set in 3.1)
      1. Open Control Panel -> System -> Advanced -> Performance -> Settings -> Advanced -> Virtual Memory
      2. Click on [Change]
      3. Click the "Custom Size" radio button
      4. Enter a value (e.g. "3584") for "Initial size (MB)"
      5. Enter a value (e.g. "3584") for "Maximum size (MB)"
      6. Click on the [Set] button
      7. Click [OK] and [Close] to get all of the open windows closed
    8. Close applications and turn off services that use a lot of memory (such as web browsers, etc.)
      1. In Services, set "Telephony" to "Automatic"
      2. In Services, set "Alerter" to "Disabled"
      3. In Services, set "Automatic Updates" to "Disabled" (NOTE: you will need to re-enable this in order to update the OS)
      4. In Services, set "Background Intelligent Transfer Service" to "Disabled" (NOTE: you will need to re-enable this in order to update the OS)
      5. In Services, set "ClipBook" to "Disabled"
      6. In Services, set "Computer Browser" to "Disabled"
      7. In Services, set "Error Reporting Service" to "Disabled"
      8. In Services, set "Help and Support" to "Disabled"
      9. In Services, set "Indexing Service" to "Disabled"
      10. In Services, set "Messenger" to "Disabled"
      11. In Services, set "NetMeeting Remote Desktop Sharing" to "Disabled"
      12. In Services, set "Remote Desktop Help Session Manager" to "Disabled"
      13. In Services, set "Remote Registry" to "Disabled"
      14. In Services, set "Terminal Services" to "Disabled"
      15. In Services, set "Themes" to "Disabled"
      16. In Services, set "Uninterruptible Power Supply" to "Disabled"
      17. In Services, set "Wireless Zero Configuration" to "Disabled"
    9. Restart the guest VM
  5. Test drive the performance settings
Proceed to the next blog on computers (not finished yet).

Return to an earlier blog on computers: Computers: Antivirus

No comments:

Post a Comment