Install Memcached

Memcached

Memcached is a general-purpose, free and open-source distributed memory caching system. It is one of the most popular caching tools and is used in such popular sites as YouTube, Reddit, Zynga, Facebook, and Twitter. If you also run dynamic, database-driven sites, Memcached may reduce resource consumption and speed up page delivery on your server as well.

Installing Memcached (daemon)

The quickest and easiest method is to install Memcached via Yum on the command line of your server.

1. Grab the RPM that matches your OS:

CentOS 6 (64 bit):

su -c ‘rpm -Uvh http://mirrors.kernel.org/fedora-epel/6/x86_64/epel-release-6-7.noarch.rpm’

CentOS 6 (32 bit):

su -c ‘rpm -Uvh http://mirrors.kernel.org/fedora-epel/6/i386/epel-release-6-7.noarch.rpm’

CentOS 5 (64 bit):

su -c ‘rpm -Uvh http://mirrors.kernel.org/fedora-epel/5/x86_64/epel-release-5-4.noarch.rpm’

CentOS 5 (32 bit):

su -c ‘rpm -Uvh http://mirrors.kernel.org/fedora-epel/5/i386/epel-release-5-4.noarch.rpm’

2. Install it with Yum:

yum install memcached

3. Start the memcached service:

/etc/init.d/memcached start

4. Configure the memcached service to start when the server boots:

chkconfig memcached on

5. Finally, disable the RPM so that it is not used for future Yum functions:

perl -pi -e “s/enabled=1/enabled=0/g;” /etc/yum.repos.d/epel.repo