Announcement

Collapse
No announcement yet.

VMware Server Tips

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    VMware Server Tips

    I posted this over on the Ubuntu forums and they "stickied" it, and I thought I would post it here for those who don't "Travel" between the two forums.

    These are just some Random Notes I have collected over the past few months that will help create a nice VMware Server setup.

    Optimize Windows guest operating systems

    Just like a physical machine, your virtual machine can suffer from the same effects of drive fragmentation, so schedule defrag to run at non-critical times to help keep your disk structure organized.

    You can always free up resources in windows, and increase security by turning off un-needed, non-critical services. Many of these services will not be needed in a virtual environment:
    • Alerter
    • Clip Book
    • Computer Browser
    • DHCP Client (Unless using DHCP IP addresses)
    • Fast User Switching Compatibility (Windows XP)
    • IMAPI CD-Burning COM Service (Windows XP)
    • Indexing Service (Unless needed)
    • Internet Connection Firewall (ICF) / Internet Connection Sharing
    • IPSEC Services
    • Messenger
    • Network DDE
    • Network DDE DSDM
    • Network Location Awareness (NLA)
    • Print Spooler (May be needed in some cases)
    • Remote Desktop Help Session Manager
    • Remote Registry (May be needed)
    • Routing and Remote Access (May be needed)
    • Smart Card
    • SSDP Discovery Service
    • System Restore Service (Windows XP)
    • Telnet (May be needed)
    • Themes
    • Uninterruptible Power Supply
    • Windows Audio (Windows XP)
    • Windows Image Acquisition (WIA)
    • Windows Time (May be needed)
    • Wireless Zero Configuration


    Make sure to turn off Desktop Wallpaper, Screensavers and any un-needed visual effects in Windows. You will not need shadow effects, font anti-aliasing and be sure to run off Minimize/Maximize animations. You can turn off “Show window contents while dragging” as well. All of these will reduce CPU workload while interacting with the Virtual Machine.

    If you are running Windows XP, you may want to disable the System Restore feature. Doing so will unlock disk space, CPU and I/O resources. It is also a good idea to disable any power management features as well, as these are usually unneeded in a virtual environment as well.

    Optimize Linux guest operating systems

    Linux guest operating systems are greatly affected by the System clock of the kernel. Linux 2.6 defaults to a 1000Hz clock tick rate, and that will put a strain on the virtual environment, and can cause problems with system time keeping. Linux 2.4 does not have this problem as the clock runs at 100Hz. If running Linux 2.6 based virtual machines, re-compile the kernel to run at 100Hz, or use one of the newer kernels (2.6.22+) which use the No HZ dynamic clock. Centos offers community developed VMware Kernels with the 100Hz option already compiled in. If you are running Ubuntu as a guest, install the "Server" kernel as it is built with the CONFIG_HZ=100 option as default.

    The following kernel boot parameters will help performance and stability using Linux 2.6 as a guest:

    Code:
    noapic nolapic apci=off clocksource=acpi_pm elevator=noop
    APCI/APIC support must be enabled if you plan on using SMP virtualization in the guest, setting the clock to PIT has shown to have better time keeping than other clock sources, your mileage may vary. Setting elevator to noop will enable the host operating system to better schedule I/O as it has an overview of the whole system as opposed to just one virtual machine.

    It is very likely that your Linux virtual machines running on VMware Server are servers themselves. Most Linux servers do not require X-Windows. When possible, do not install a graphical desktop -- just use the character-based console. Your Linux virtual machine will require much less resources.

    If you do need a graphical desktop, then use a light-weight window manager such as WindowMaker, IceWM, Fluxbox or if you need more features with a little less bloat, XFCE is a great alternative to GNOME.

    Just like Windows guests, when optimizing your Linux virtual machines, make sure that you disable or remove unnecessary daemons, services and background tasks.

    VMX Options to improve General Guest OS Performance

    The following options will help get the most performance out of your guest environment:

    Code:
    MemTrimRate = “0″
    sched.mem.pshare.enable = “FALSE”
    MemAllowAutoScaleDown = “FALSE”
    The above options will disable memory trimming and sharing.

    Optimize Linux host operating systems



    As a host OS, Linux CAN have the reverse problem as Linux Guests when it comes down to the Kernel System clock. While Linux 2.6 defaults to 1000Hz, many distributions (notably, Debian, SuSE, and Ubuntu) compile their kernels at 250Hz to offer a balance of throughput and desktop interactivity. 250Hz is considered by some to be too low for a VMware Host OS as it can cause some “rtc: lost some interrupts” errors to show up in your logs. It is recommended to use a Kernel with the 1000Hz option enabled. You can compile your own, or if running Ubuntu 7.04 there is a “Low Latency Kernel” in the repositories that works quite well as a VMware host. DO NOT run a “Real Time” kernel as this might work well for a Single VM on a Host doing nothing else (which is seldom the case), Multiple VM’s will suffer.



    If you are using Linux as the host for VMware Server, you may notice performance issues in relation to I/O, here are some pointers when configuring a VMware server:

    Use a RAID array if at all possible, RAID 1+0 will have the best performance and reliability, set block size to 64K and make Ext3/Ext2 aware of this: set blocksize to 4096 as virtual disks will use large blocks regardless, if you have used 64K strips specify stride as 8 or 16.

    Code:
    mke2fs -b 4096 -R stride=8 <device>
    If you have a stable power source, consider using ext2 or data=writeback option on ext3 partions, this will have a significant performance increase at the cost of data loss if you lose power.

    Make sure to have sufficient memory in the virtual machine as well as the host operating system, if you are using swap your performance on I/O will drop significantly.

    On the host operating system, consider using deadline I/O scheduler which is enabled by adding this line to the kernel boot parameters:

    Code:
    elevator=deadline
    The noop I/O scheduler is great fo the guest if it is running Linux 2.6; using the noop scheduler enables the host operating system to better optimize I/O resource usage between different virtual machines.

    This can be added by adding this line to the kernel boot parameters of the guest:

    Code:
    elevator=noop
    Read ahead on the hard drive should be set to an optimal value, this can be changed by executing:

    Code:
     blockdev –setra <read ahead in bytes> <device>
    I have found an optimal value is between 16384 and 32768.

    The following virtual memory & I/O subsystem tunables (/etc/sysctl.conf) are useful, they help significantly with I/O performance:

    Code:
    vm.swappiness = 0
    vm.overcommit_memory = 1
    vm.dirty_background_ratio = 5
    vm.dirty_ratio = 10
    vm.dirty_expire_centisecs = 1000
    dev.rtc.max-user-freq = 1024
    Disabling the kernel from over committing memory and only using swap when physical memory has been exhausted helps overall performance (vm.swapiness). The maximum user frequency covers how fast a virtual machine can set it’s tick count to. The vm.dirty options tune how the VM subsystem commits I/O operations to disk, you may not want to tune these values if you do not have a stable power source.

    Although I can't even remember all the sources, Thanks to all the folks who figured this stuff out before I did :-) I found this info all over the web at various times in different articles and/or blogs.
Working...
X