top
logo


Home LAMP Linux CentOS 5 Minimalist

CentOS 5 Minimalist

PDF Print E-mail
(8 votes, average 5.00 out of 5)
Written by Alex Balyuk   
Tuesday, 03 August 2010 13:35

centos_logo_45

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 applicationdistributed application with share nothing architectureshare 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 ServerVMware 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 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:
centos5_minimalist_html_m4fcb2fd6

Running for 1 hour:
centos5_minimalist_html_m6c860ed4

Settings vfs_cache_pressure and running for 2 hours:
centos5_minimalist_html_m4fcb2fd6

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

  1. Download CentOS 5 [i386] DownloadDownload

    You can download 64-bit architecture here64-bit architecture here. You will require more memory for 64-bit architecture (At least 256 MB).

  2. Start installation in the Graphical Mode
  3. When you get to the screen below, do the following:
    • Uncheck ALL, except for Server.
    • Select Customize Now to configure software packages.

      Desktop - Gnome/KDE because we do not need it, this option will be loading Desktop environment into the memory during each boot, wasting precious memory.

      centos5_minimalist_html_m50906ee3

  4. Configuring Packages that have to be selected.
    • Desktop Environments - NONE
    • Applications

      • Editors
    • 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

      • Base
    • Virtualization - NONE
    • Clustering - NONE
    • Cluster Storage - NONE
    • Languages - NONE (English is the default, it is not in the list)
  5. After installation is completed and server reboots Setup Agent will appear
    • Authentication
    • Firewall Configuration
      centos5_minimalist_html_36307478

    • 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
  6. centos5_minimalist_html_7b3e350e

  7. Login as ROOT
    Open /etc/sysctl.conf for editing with your favourite editor
    vim /etc/sysctl.conf

    And add this line to the bottom of the file
    # Cache Pressure
    vm.vfs_cache_pressure = 10000
    
     
    Reboot your machine 
    reboot
     

    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 

 
+1 #1 Nick 2010-08-04 19:27
This is awesome. Great for VPS configuration.
Quote
 
 
+1 #2 Roberto 2010-10-04 11:36
echo 10000 > /proc/sys/vm/vfs_cache_press ure

Don't you need to put an entry in /etc/sysctl.conf ? After reboot your setting will be lost...
Quote
 
 
0 #3 Alex Balyuk 2010-10-05 03:59
Quoting Roberto:
echo 10000 > /proc/sys/vm/vfs_cache_press ure

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!
Quote
 
 
+1 #4 moredruid 2011-01-21 12:39
Quoting Alex Balyuk:
Quoting Roberto:
echo 10000 > /proc/sys/vm/vfs_cache_press ure

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.
Quote
 

Add comment


Security code
Refresh



Copyright © 2012 (bool) cast.com. All Rights Reserved.
Joomla!Joomla! is Free Software released under the GNU/GPL License.GNU/GPL License.

bottom
top
Site Map | Contact Us

bottom