Peter Kieser

Apathy has replaced guns.

VMware Server 1

without comments

VMware Server Issues: VMware server is far from perfect, here are some issues that I have run into (and hopefully their solutions).

General Network Latency & Tuning

Abnormally high latency with networking on VMware can be caused by using a virtual disk/physical disk as an IDE drive, use LSI Logic or Bus Logic emulation instead. To convert a virtual disk from IDE to SCSI follow this guide.

  • Use e1000 (Intel Pro 1000) network interface in VMware guest instead of vlance or vmxnet, this can be set by editing the VMX of your guest and adding Ethernet.virtualDev="e1000". Note that 64bit guests use e1000 interface by default.
  • Consider setting a Static MAC address, generate one with this tool. VMware has a knowledge base article that describes how to set/change a static MAC address.

VMware MUI on Ubuntu 7.04 Server

If you receive "httpd.vmware: error while loading shared libraries: libdb.so.3" when attempting to start VMware Management Interface, use the following commands to rectify the problem:

apt-get install libdb3
ln -s /usr/lib/libdb3.so.3.0.2 /usr/lib/libdb.so.3

While VMware MUI ships with libdb.so.3 it is not referenced by the Ubuntu distribution, the above command will install the native libdb3 and symlink it to the appropriate location, tested on an AMD64 host.

FreeBSD Guest – Time Keeping

The time keeping on a FreeBSD guest is not perfect, the "skew" gets out of hand after a few minutes (The kern.hz only applies to FreeBSD versions before 7.0 as the default in 7.0 and above is 100Hz), to rectify the problem add the following to /boot/loader.conf:

kern.hz=100
hint.apic.0.disabled=1

The default "tick" on FreeBSD is 1000 Hz, which is far greater than what a virtual machine can keep up with accurately, 100Hz is more reasonable value. APIC has been known to cause issues with FreeBSD, but is required if you are using SMP in your guest (2 or more processors).

Linux 2.6 Guest – Time Keeping & Stability

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

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.

To enable these values, add them to /boot/grub/menu.lst at the end of the kopt line and run update-grub.

General Performance – Tunables in VMX

Have memory to spare? The following options will help get the most performance out of your guest environment:

MemTrimRate = "0"
sched.mem.pshare.enable = "FALSE"
MemAllowAutoScaleDown = "FALSE"
mainMem.useNamedFile = "FALSE"

The above options will disable memory trimming and sharing. They will also disable VMware from using it's internal swap and using the hosts instead, having a significant performance gain of not having a journaled file system for swap.

Linux 2.6 Host I/O Performance

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:

  • For best performance (but very sensitive to power failure and consistancy issues) consider using SGI XFS. It has excellent performance with VMware in real world situations.
  • 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 (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 (enabled by adding elevator=deadline to kernel boot parameters), and noop I/O scheduler in 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.
  • Kernel tick count on the host should be increased on the host to prevent RTC errors from appearing, I have found having the tick at 1000 Hz to be the most optimal, refer to your Linux distributions guide on how to recompile the kernel with a higher tick rate.
  • Read ahead on the hard drive should be set to an optimal value, this can be changed by executing 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:

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.

Hardware Virtualization Extensions (Intel & AMD)

Intel and AMD have implemented new hardware virtualization extensions, which are currently being implemented by VMware. I originally thought that the extensions would help both 32bit and 64bit virtualization, however I have found out that they only significantly help out with 64bit guests, and can actually hurt performance on 32bit guests.

If you are able to configure a guest to use a 64bit operating system, you will see performance improvements from using the extension, otherwise you will not.

3rd party patches for VMware

The following patches are ones for VMware that I have found useful at one time or another, they are not supported by VMware. If you are on a support contract for VMware or are attempting to get support from them, do not apply these patches.

  • VMware any-any-up: If you have problems with building kernel modules, or if VMware application refuses to run complaining that your kernel is too new, it is time to download this patch.
  • vmgbd (VMware generic device block patch): This utility patches VMware to use any block device (LVM, loop, etc.) as a hard drive.

Useful Links

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Slashdot
  • Twitter

Written by Peter

November 6th, 2007 at 1:41 pm

Posted in