In this article we will learn how to install Memcached on CentOS linux server. But, first we will discuss what is Memcached and for what purpose it is used.

What is Memcached ?
Memcached is a open source distributed, high performance memory object caching program that is primarily used to speeding up performance of dynamic web applications that make heavy use of databases by caching data and objects in Memory. Memcahed can be used to store any kind of objects and used to cache entire database tables or queries to improve performance. Memcached is quite speedy as it does not write data on disk because it runs on memory. Memcahed is used by almost all popular CMS and many big websites like Facebook, Twitter,Youtube, Drupal, and many other programming languages have Memcached libraries.

Steps for Installation of Memcached on Server :

1). First, you have to clean Yum before installing memcahed.
-----
# yum clean all
-----

2). Then, download the latest version of memcached. you can google for the latest version.
-----
# wget wget http://memcached.org/files/memcached-1.4.21.tar.gz
-----

3). Now, unpack the tar file.
-----
# tar xvzf memcached-1.4.21.tar.gz
-----

4). Before installing update all packages.
-----
# yum -y update
-----

5). Now run this command to install memcached,
-----
# yum -y install memcached
-----

6). You can configure memcached parameters through this command :
-----
# vim /etc/sysconfig/memcached
-----

Default file look like below given values. You can change according to your need.
-----
# Running on Port 11211
PORT="11211"
# Start as memcached daemon
USER="memcached"
# Set max simultaneous connections to 1024
MAXCONN="1024"
# Set Memory size to 2048 - 4GB(4096)
CACHESIZE="2048"
#Set server IP address
OPTIONS="-l 127.0.0.1"

-----

7). After making changes you have to restart memcached.
-----
# /etc/init.d/memcached restart
-----
Author
bhawanisingh
Views
1,819
First release
Last update
Rating
0.00 star(s) 0 ratings
Top