VM Performance
Jump to navigation
Jump to search
I will document some tweaks and tips to increase performance of a Linux virtual machine. Many tips will likewise apply to physical machines as well, but the focus is on virtual machine technology.
Inside the VM
SMP vs. Uniproc
Because a hypervisor already multiplexes cpu cycles to the VMs that need it, there is usually nothing to be gained from configuring SMP within a VM. In fact the addl overhead of SMP can actually slow down a VM.
Result: Use uniprocessor
Filesystem
- If possible, use a performance-enhanced filesystem such as xfs and jfs, which are reportedly MUCH faster then ext3
- For JFS under CentOS-4 you will need the "plus.c4" kernel from "extras" repo and jfsutils.
Web servers
Consider lighttpd instead of apache.
Getty
There is little need to getty to be running on more than a couple of ttys. By removing tty3-tty6 you can save a couple MB of RAM and some tiny amount of processor time.
Comment out the lines (shown below) in /etc/inittab
# Run gettys in standard runlevels 1:2345:respawn:/sbin/mingetty tty1 2:2345:respawn:/sbin/mingetty tty2 #3:2345:respawn:/sbin/mingetty tty3 #4:2345:respawn:/sbin/mingetty tty4 #5:2345:respawn:/sbin/mingetty tty5 #6:2345:respawn:/sbin/mingetty tty6
Send a SIGHUP to init to re-read the inittab file
kill -HUP 1
Outside the VM (on the host)
Storage
- Use RAID 0+1 or RAID-10, as it is the fastest disk access possible.
- Consider your filesystem type, xfs and jfs are reportedly MUCH faster then ext3