Adjust your slab! Memcached 1.4.12 RPMs on CentOS 5.7.




So, memcached 1.4.11 lets you rebalance and reassign slab memory!

This is epic!

Info why this is epic here.

Info on the implementation is in the release notes

From the release notes, please remember that the slab reassignment feature is in beta and is subject to some changes.

I just took the regular spec file I found for the project elsewhere and modified it a little. I disabled the SASL stuff in my spec file since we don’t use it and I didn’t want to mess with building it.

EDIT: Actually, this article has revised for less yak shaving. With the help of Dormando and Justin Lintz. I was able to shed some unneeded dependencies.

So here you go:

Setup your RPM Build environment and some dependencies:

sudo yum -y install rpmdevtools libevent-devel 
rpmdev-setuptree

Grab and place the source and spec file:

wget http://memcached.googlecode.com/files/memcached-1.4.12.tar.gz \
   -O ~/rpmbuild/SOURCES/memcached-1.4.12.tar.gz 
wget https://raw.github.com/nmilford/specfiles/master/memcached-1.4/memcached-1.4.spec \ 
   -O ~/rpmbuild/SPECS/memcached-1.4.spec

Build the RPM:

rpmbuild -bb ~/rpmbuild/SPECS/memcached-1.4.spec

And here on you can install it:

sudo rpm -Uvh ~/rpmbuild/RPMS/x86_64/memcached-1.4.12-1.x86_64.rpm

On nodes you didn’t just install libevent-devel on to build it, you’ll want to install libevent.

sudo yum -y install libevent

From here on, set your cache size and other stuff in /etc/sysconfig/memcached, but mainly you’ll want to enable the slab manipulation option.

Under the OPTIONS environment variable add -o slab_reassign for manual adjustment and -o slab_reassign,slab_automove if you want to try out the automatic memory reassignment algorithm.

Now you can fire it up!

sudo /etc/init.d/memcached start

You can verify it is up and responsive thus:

echo stats | nc localhost 11211

You can see info on the slab stuff here:

 echo stats | nc localhost 11211 | grep slab 

And you can turn the automatic algorithm on or off on a live instance:

echo "slabs automove 0" | nc localhost 11211 

Ha ha! Glorious Victory!

Share
  • http://profile.yahoo.com/MEPCN5NUGPA4ZSWDIG3JV4NE6U Anthony

    P.S. If you use yum to install the rpm, libevent would be installed as a dependency, if you .spec file is setup right. e.g. “sudo yum -y –nogpgcheck localinstall ~/rpmbuild/RPMS/x86_64/memcached-1.4.11-1.x86_64.rpm”

  • http://twitter.com/santisaez Santi Saez

    Hello,

    Using PowerStack repository you can run latest memcached stable version in your CentOS boxes (4, 5 and 6 releases supported, i686 + x86_64), last LAMP stack stable versions and other key packages like: nginx, HAproxy, node.js, redis, Varnish, etc.

    It’s free software and all code is available on GitHub, check out the wiki page for installation instructions :)

    http://powerstack.org

    Santi

  • http://photo24.pl/ Fotograf Rzeszów

    I love memcached from first used.
    All my web appliaction used it – and my mysql server load is now minimal.