Reduce Linux VPS/VM guest memory usage
Published April 6th, 2009 by Paul De AudneyReducing the memory usage in your VPS/VM can be a great way to free up some resources to handle more requests, users or some other metric of win.
By default at Anchor we provision our Red Hat & Cent OS VPS servers with a trim memory usage profile by disabling a lot of unneeded services at install time. We do this by using Trogdor (our hardware/software burninator) and Puppet.
So just what services do we disable, if they exist on the new VPS?
- gpm
- netfs
- pcmcia
- sgi_fam
- yum-updatesd
- pcscd
- rhnsd
- xfs
- hald
- hcid or sdpd
- hpiod or hpssd.py
- dbus-daemon
- cupsd
You can also reap performance gains by changing how you serve content. For example you can use a cut down high performance web server (nginx or lighttpd) to serve all static content, such as images. Then use an Apache process to handle your dynamic requests.
Tuning Apache is deserving of an article all to itself, however some hard and fast rules are:
- Disable all unnecessary modules.
- Work out the per process memory usage, and set your max clients to a suitable number taking into account the available memory and other system daemons.
- Disable htaccess if you do not need it.
PHP is much the same as Apache, disable what you do not need. This goes for any service or application with many optional components.
[...] Reducing the memory usage in your VPS /VM can be a great way to free up some resources to handle more requests, users or some other metric of win. By default. See the original post here: Reduce Linux VPS/VM guest memory usage | Anchor Web Hosting Blog [...]
[...] Original post: Reduce Linux VPS/VM guest memory usage | Anchor Web Hosting Blog [...]
You might as well also disable smartd (unless you are using RDMs), bluetooth and hidd as well.
While not installed by default, you don’t need to install ntpd either if you have vmware tools installed (vmware-guestd –cmd “vmx.set_option synctime 0 1″).