How To Install Memcached On A Vps Server Or A Dedicated Server?


Memcached is a Unix daemon written in C that exposes a specified amount of memory space as a hash table on the network using a dedicated text or binary protocol. The protocol allows a limited set of operations such as set, get, and delete, and also some more complex atomic operations such as cas (compare and set), incr, decr, and append.

The process itself is absolutely unaware of any distribution and partitioning logic, thus making it extremely simple, fast, and robust. All the complexity is actually pushed to the client that is responsible for routing requests to the correct Memcached instance. A very common use of Memcached is to partition data on each instance, without replication.

This strategy is valid when the amount of instance N is big as a loss of one instance will involve loss of 1 / N of data, which is acceptable in most cases for caching. In situations where such data loss isn’t acceptable, replication is possible as the client can simply send its requests to 2 Memcached instances in parallel.

At the time of writing, it is widely used in production in large organizations. Clients are available for all major languages, including C/C++, Java, Python, Ruby, and C#.

To install memcached on a Virtual Private Server(VPS) or a dedicated server follow the below mentioned steps-

mkdir -p /root/source

cd /root/source

wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i…

rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm

yum -y install libevent* ( required for memcached binary )

yum -y install memcached* ( memcached binary required for libmemcached )

gem source -a http://gems.github.com

* combination of libmemcached-0.25.14 and memcached-0.13 gem is found to be a working stable combination, so we will be sticking to this combination for now.

wget http://blog.evanweaver.com/files/libmemcached-0.25.14.tar.gz

tar -xzvf libmemcached-0.25.14.tar.gz

cd libmemcached-0.25.14

./configure && make && make install

cd /root/source

wget http://blog.evanweaver.com/files/memcached-0.13.gem

gem install memcached-0.13.gem

gem install memcache-client –version=1.6.3

Source: RailsCarma

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s