|
Written by Alex Balyuk
|
|
Tuesday, 03 August 2010 13:35 |
|

Virtualization is very popular nowadays. There is no need to have hundreds of phisical computers, one powerful server can manage 10+ virtual machines on its own. I worked on a distributed application with share nothing architecture that requiered minimum of 8 nodes and a master server. The nodes interact with master server via API calls and constantly processed little chunks of data (time consuming task with little CPU usage) and reported back to the master server. The problem arrised when VMware Server started getting slugish, therefore all the nodes became very slow. To fix the problem I came out with idea to minimize the nodes at much as possible, living only importan operating system and application specific services running. In this article you will find out how to setup RHEL (Cent OS 5) server with minimal resource usage and how to work around crazy RHEL caching that uses 50%+ of RAM.
SUMMARY
- Configuration Time: 10 Minutes
- Installation Time: 5-10 Minutes
- Maximum memory used during the installation process: 80 MB
- OS Runtime Max RAM Used: 116 MB
- OS HD Space Used: 1.2G
Running for 10 minutes: 
Running for 1 hour: 
Settings vfs_cache_pressure and running for 2 hours: 
As you can see after settings vfs_cache_pressure Linux Kernel is cleaning page_cache and innode_cache. We can see 200%+ increase in free memory.
VM SPECS
- RAM: 128 MB
- HDD Size: 4 GB
TO DO
- Download CentOS 5 [i386] Download
You can download 64-bit architecture here . You will require more memory for 64-bit architecture (At least 256 MB).
- Start installation in the Graphical Mode
- When you get to the screen below, do the following:
- Configuring Packages that have to be selected.
- Desktop Environments - NONE
-
Applications
- Development - NONE
-
Servers
- DNS Name Server
- Mail Server
- Server Configuration Tools
- Web Server - only following Packages
- crypto-utils
- dlstcache
- mod_ssl
- php-5
- php-mysql
-
Base System
- Virtualization - NONE
- Clustering - NONE
- Cluster Storage - NONE
- Languages - NONE (English is the default, it is not in the list)
- After installation is completed and server reboots Setup Agent will appear
- Authentication
-
Firewall Configuration 
- Network configuration - configure DNS to your specs
- System services - configure startup services here
- NetworkManager - OFF
- acpid - ON
- anacron - ON
- apmd - ON
- atd - ON
- auditd - ON
- autofs - OFF
- avahi-daemon - ON
- avahi-dnsconfd - OFF
- bluetooth - OFF
- conman - OFF
- cpuspeed - ON
- crond - ON
- cups - OFF
- dc_client - OFF
- dc_server - OFF
- dnsmasq - OFF
- dovecot - ON
- dund - OFF
- firstboot - ON
- gpm - ON
- haldaemon - OFF
- hidd - OFF
- httpd - ON
- ibmasm - OFF
- ip6tables - ON
- iptables - ON
- irda - OFF
- irqbalance - OFF
- kudzu - OFF
- lvm2-monitor - OFF
- mcstrans - OFF (enable ONLY if SELinux is ON)
- mdmonitor - OFF (enabled ONLY if RAID is used)
- mdmpd - OFF
- messagebus - ON
- microcode_ctl - ON
- multipathd - OFF
- named - OFF
- netconsole - OFF
- netfs - OFF
- netplugd - OFF
- network - ON
- nfs - OFF
- nfslock - OFF
- nscd - OFF
- oddjobd - OFF
- pand - OFF
- pcscd - OFF
- portmap - ON
- psacct - OFF
- rawdevices - OFF
- rdist - OFF
- readahead_early - ON
- readahead_later - OFF
- restoredcond - OFF (enabled only if SELinux is ON)
- rpcgssd - ON
- rpcidmapd - ON
- rpcsvcgssd - OFF
- saslauthd - ON
- sendmail - ON
- smartd - OFF
- smb - OFF
- spamassasin - OFF
- squid - OFF
- sshd - ON
- syslog - ON
- tcsd - OFF
- tux - OFF
- winbind - OFF
- wpa_supplicant - OFF
- ypbind - OFF
- yum-updatesd - ON

- Login as ROOT
Open /etc/sysctl.conf for editing with your favourite editor
And add this line to the bottom of the file
# Cache Pressure
vm.vfs_cache_pressure = 10000
Reboot your machine
References
About CentOS
CentOS 4 Minimal
Settings-up LAMP server with CentOS
Caching Problems
About Linux Services
|
|
Last Updated on Tuesday, 05 October 2010 03:55 |
Comments
Don't you need to put an entry in /etc/sysctl.conf ? After reboot your setting will be lost...
You are absolutely, right. I did not know that echo is just temporary... until few servers became sluggish. I corrected the problem, but never fixed it here.
Thank you for your input!
sysctl -p will effectuate the kernel settings in /etc/sysctl.conf without needing a reboot.