PermaLink VMware optimize Linux guest operating systems12/07/2008 12:10 AM


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.

I understand you built a 100Hz kernel, but  you might want to try CentOS-supplied 100Hz kernel (kernel-vm) available from: http://people.centos.org/tru/kernel-vm/

CentOS provides 100Hz kernels that are suitable in a virtual environment. They have still in the testing repository but are known to work. You can find them at: http://dev.centos.org/centos/5/testing/

Quote: From reading http://wiki.centos.org/Manuals/ReleaseNotes/CentOS5.1
One of the features added to 5.1 is a new kernel option that allows you to adjust the system clock rate. With this option you can reduce the clock rate from the default of 1000HZ to 100HZ which is desirable in a virtual machine. The official upstream Release Notes states that this option is given as "tick_divider=<value>". However, this is a typo. The correct option is "divider=<value>".

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 ( also I have seen nohz=off )

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 KDE or 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:
MemTrimRate = “0″
sched.mem.pshare.enable = “FALSE”
MemAllowAutoScaleDown = “FALSE”
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

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. Some distro’s that make excellent VMware hosts without resorting to custom kernels are CentOS, Fedora and Mandriva as they all run a 1000Hz kernel by default.

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 (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. Depending on the support of your Distribution, also consider using the JFS or XFS filesystem for the drive that hosts your virtual disks.
  • 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.

More @jaysonrowe.wordpress.com


Technorati:
ClusterMaps
Locations of visitors to this page
Promotion Engines
Photo Albums
Badkey Information
Where are we ?

Alblasserdam
Albrandswaard
Alkemade
Alphen
AlphenaandenRijn
Ambacht
barendrecht
Beijerland
Bergambacht
Bernisse
Binnenmaas
Bodegraven
Boskoop
Brielle
Capelle
CapelleaandenIJssel
Capelle aan den IJssel
Cromstrijen
Delfland
Delft
Dirksland
Dordrecht
Giessendam
Giessenlanden
Goedereede
Gorinchem
Gouda
gouderak
Graafstroom
Gravenhage
Hardinxveld
Hellevoetsluis
Hendrik
Hillegom
Ido
Ijssel
Jacobswoude
Katwijk
Korendijk
Krimpen
KrimpenaandenIJssel
Krimpen aan den IJssel
Lansingerland
Leerdam
Leiden
Leiderdorp
Leidschendam
Lekkerland
Liesveld
Lisse
Maassluis
Middelharnis
Moerkapelle
Moordrecht
Nederlek
Nieuw
Nieuwerkerk
NieuwerkerkaandenIJssel
Nieuwerkerk aan den IJssel
Nieuwkoop
Noordwijk
Noordwijkerhout
Nootdorp
Oegstgeest
Oostflakkee
Ouderkerk
Papendrecht
Pijnacker
Reeuwijk
Ridderkerk
Rijn
Rijnwoude
Rijswijk
Rotterdam
Rozenburg
Schiedam
Schoonhoven
Sliedrecht
Spijkenisse
Strijen
Teylingen
Vlaardingen
Vlist
Voorburg
Voorschoten
Waddinxveen
Wassenaar
Westland
Westvoorne
Zederik
Zevenhuizen
ZH
Zoetermeer
Zoeterwoude
Zwijndrecht

ICT
ICT

IT Manager
ICT-manager
Systeembeheerder
Senior Lotus Notes Administrator
Consultant WAN
Consultant Messaging
Consultant Security
Domino Infrastructure Specialist

Linked In
View John Willemse's profile on LinkedIn
Powered By ND8
nd8-block.jpg
Search
StatCounter Statistics

View My Stats
Visitor Activity Planetlotus.org
My site Badkey.com
Who is following me
Astaro Internet Security
NetApp: Storedata
Zuidplas Actief
Google Badkey
Dutch VMware Usergroup
Google Analytics
Analytics blogspot
Ego Surf
Add to Google
Add to Google
Google AdSence
Timer Count Down LS2010
5 Years from now
My birthday 2010
Twitter
twitter_sized.jpg