Sunday, August 5, 2012

How to Compile and Install the Latest Memcached from Source on Linux

Compiling Memcached directly from source allows you to take advantage of the latest concurrency fixes, memory management optimizations, and binary protocol improvements that may not yet be available in standard distribution package repositories.

Prerequisites: libevent and build development tools.

1. Install Dependencies

Memcached depends on the libevent event notification library:

# On CentOS / RHEL:
yum install libevent-devel gcc make -y

# On Debian / Ubuntu:
apt-get install libevent-dev build-essential -y

2. Download and Build Memcached

Fetch the latest release tarball and compile:

cd /usr/src
wget http://memcached.org/latest -O memcached-latest.tar.gz
tar -zxf memcached-latest.tar.gz
cd memcached-*
./configure --prefix=/usr --sysconfdir=/etc
make
make test
make install

3. Starting the Daemon

Launch Memcached as a non-privileged user (e.g. nobody) with 64MB memory limit listening on localhost:

memcached -d -u nobody -m 64 -p 11211 -l 127.0.0.1

Confirm the service is actively listening:

netstat -tulpn | grep 11211

No comments:

Post a Comment

Jitsi TV HD: Native 720p @ 30fps USB Webcam Video Calls on Sony BRAVIA Android TV

Note: This is a personal hobby project built with AI-assisted coding and debugging to solve a specific Sony BRAVIA Android TV USB webcam iss...