How can I optimize the performance of my Virtual Machine environment?
This article's recommendations are intended as suggestions for Notification Server and Solutions lab testing or proof of concept builds. Some of these settings will apply to both physical and virtual servers. Because resources are generally more limited in labs, some suggestions will differ from best practices in a production virtual environment.
Following are suggestions for optimizing a virtual machine environment for speed:
- If using IDE or SATA disk drives on the host in a test environment, consider enabling 'Advanced Performance' for the disk drive(s). In the Device Manager tree on the host, expand Disk Drives. Double-click the disk drive hosting the virtual machines and go to the Policies tab to find this setting. Enabling Advanced Performance may not be advisable in certain production environments due to the added risk1.
- Review the following before selecting the type of disk controller to be used for the guest:
- For best disk drive performance, attach your virtualized disk drive using the VMware LSI Logic SCSI controller.
- If using VMware Workstation 6.0 or lower, with SQL Server on-box inside the VM, attach your virtualized disk drive using the VMware IDE controller2.
- If available physical memory is adequate for all running VMs, you can reduce a VM's I/O by going to the VM menu, Settings, Options tab, Advanced page and selecting 'disable memory page trimming'.
- Virtual disk allocation:
- Preallocate the full capacity to the virtual disk during creation when storage space is available to avoid extra I/O overhead associated with growable disks.
- Allocate adequate RAM to the guest OS:
- With SQL Server on-box, running NS 6.x, 1GB or more
- With SQL Server on-box, running NS 7.x, 2GB or more
- Allocate Virtual CPUs:
- With NS 6.x, 1 vCPU is generally sufficient
- With NS 7.x, 2 vCPUs are recommended
- Install the current virtual machine tools (accelerated drivers) into the guest OS.
- If building a dedicated SQL Server VM, see HOWTO10723: Optimizing SQL Server 2005 on Windows Server 2003.
- If SQL Server is installed inside the guest, optimize Windows' memory allocation settings:
- Under Computer Properties, Advanced tab, Performance section, click the Settings button, Advanced tab. In the Memory usage section, click the Adjust for best performance of: Programs radio button.
- Under Control Panel, Network Connections, open the active network connections properties, go to the File and Printer sharing for Microsoft Networks properties and click the 'Minimize memory used' radio button
- Defragment the virtual machine host and guest drives as needed. Following is the optimal order to defragment3:
- IMPORTANT: Do NOT defragment inside the guest if any snapshots exist or performance will be degraded. Defragment before taking a snapshot.
- Defragment the disk inside the guest OS and shut down the guest.
- For VMWare, run a defrag using the VM menu, Settings, double-click the disk to defrag and click the Defragment button.
- Defragment the host drives.
- Stop! Is Your System Set Up Correctly? - http://www.intel.com/cd/ids/developer/asmo-na/eng/189869.htm?page=3
- SQL storeng errors or SQL tempdb 'bad page id' errors logged while installing Solutions - TECH33607
- Defragmenting Virtual Disks - http://www.vmware.com/support/ws55/doc/ws_disk_defrag.html
- How to boot VMware clients in WinPE 2.0 and 2.1 - HOWTO8639