VM Performance: Difference between revisions

From ConShell
Jump to navigation Jump to search
(initial page)
 
Line 12: Line 12:
=== Web servers ===
=== Web servers ===
Consider lighttpd instead of apache.
Consider lighttpd instead of apache.
=== Terminal Emulator (xterm et al) ===
I recommend mrxvt over gnome-terminal or konsole. It has a much lower memory footprint.
=== Shell ===
Dash is a shell that uses much less memory than bash. Users have reported freeing up to 12MB of RAM by switching to dash. [http://www.unixshell.com/wiki/index.php/Using_dash_instead_of_bash link]


=== Getty ===
=== Getty ===
Line 29: Line 35:
  kill -HUP 1
  kill -HUP 1


=== Turn off unnecessary services ===
Much like getty listening to ttys, the default configuration of most Linux distributions is not well suited to performance. Here are some things I tend to turn off in CentOS and Red Hat.
* X windows (set default to 3 in /etc/inittab)
** xfs - x font server, optional
** gdm - if the inittab tweak above doesn't cut it
* isdn
* pcmcia
* anacron
* kudzu
=== Install vmware-tools ===
Obviously this only applies if VMware is your underlying platform.
=== Other misc ===
Turn off selinux, ipv6, auditd


== Outside the VM (on the host) ==
== Outside the VM (on the host) ==

Revision as of 01:23, 21 April 2007

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.

Terminal Emulator (xterm et al)

I recommend mrxvt over gnome-terminal or konsole. It has a much lower memory footprint.

Shell

Dash is a shell that uses much less memory than bash. Users have reported freeing up to 12MB of RAM by switching to dash. link

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

Turn off unnecessary services

Much like getty listening to ttys, the default configuration of most Linux distributions is not well suited to performance. Here are some things I tend to turn off in CentOS and Red Hat.

  • X windows (set default to 3 in /etc/inittab)
    • xfs - x font server, optional
    • gdm - if the inittab tweak above doesn't cut it
  • isdn
  • pcmcia
  • anacron
  • kudzu

Install vmware-tools

Obviously this only applies if VMware is your underlying platform.

Other misc

Turn off selinux, ipv6, auditd

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