[clug] General Virtual Machine performance tuning

George at Clug Clug at goproject.info
Tue Sep 30 21:55:39 MDT 2014


When creating a Linux virtual machine, these are a few modifications
that I do, believing that they will help with performance.

Please let me know if you agree or disagree with these changes (and
why), and if you have any other changes you like to do.  I do not
believe these are essential or necessarily, or, all required, they are
just how I like to build VMs.

Install Debian with ssh, static IP address, and with or without GUI
(whether headless or with GUI, is your preference). There are times
when I will use XFCE as a GUI because it adds very little overhead to
resources while allowing for testing/working with the VM when it is
network-isolated by itself.

nano /etc/apt/sources.list
Add contrib non-free to all three repositories

apt-get update
apt-get install xinetd ntp ssh rsync fail2ban build-essential
linux-headers-$(uname -r)

server 0.au.pool.ntp.org
server 1.au.pool.ntp.org
server 2.au.pool.ntp.org
server 3.au.pool.ntp.org

ntpq -p
/etc/init.d/ntp restart
# Test NTP using 
ntpq -p

Add to the hosts file the FQDN and IP addresses of any servers that
this server will need to communication with.
nano /etc/hosts

Check that the runlevel in /etc/inittab  is set to 3 or less, e.g.
“id:2:initdefault” which stops the kernel from running a number of
high level services that are not required (e.g. X Windows). If you
installed your Debian server as a “headless” installation, that is
without X Windows you should find that the setting is # The default

nano /etc/inittab 

Add “evelator=noop” to the GRUB_CMDLINE_LINUX_DEFAULT option so
that the kernel does not bother to optimise disk I/O, as the ESXi host
will be performing I/O optimisation. 
nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet elevator=noop" 

Add “noatime” to the mounting of any virtual hard disks, which
stops operations to update the last accessed time for file reads. Does
not stop create/modify time recording.  This can noticeably reduce
file I/O.  
nano /etc/fstab 
# / was on /dev/sda1 during installation
/               ext3    errors=remount-ro,noatime
0       1

Disable the reporting of RAID array status (since this Debian VM
server is not using RAID).
# /etc/init.d/mpt-statusd stop
# echo RUNDAEMON=no > /etc/default/mpt-statusd
# apt-get remove mpt-status

More information about the linux mailing list