Wednesday, August 8, 2007

installing and running memcached

memcached is a general-purpose distributed memory caching system.
It is often used to speed up dynamic database-driven websites by caching data and objects in memory to reduce the amount the database needs to be read.

memcached is dependent on libevent library, so firstly download the source files for Libevent

Install libevent:

$ tar -xvf libevent-1.3c.tar.gz
$ cd libevent-1.3c
$ ./configure
$ make
$ make install

In Fedora the library ( will be installed at
Create a link or copy this file to standard libarary location (/lib) of Fedora
$ cd /lib
$ ln -s /usr/local/lib/

Download the latest memcached from

$ tar -xzf memcached-1.2.2.tar.gz
$ cd memcached-1.2.2
$ ./configure
$ make
$ make install

$ memcached -h
(Will display various options)

To run as a deoman
$ memcached -d -u apache
Will start as daemon with default options Port(p): 11211 and Max memory (m) to use: 64MB


Kunal Seth said...

Hi sanjay, when i am running memcahe its giving me an error...error loading shared library

amythical said...

Thanks for the post mate

Dwayne Macgowan said...

@Kunal Seth
you can solve that error installing with this veeery simple tutorial (same as this one but with some other configuration flags)

Benny said...

Thanks! It works perfectly on Debian with libevent-2.0

Whats new in Ajuby 0.5