Installing memcached
host ~ # emerge -pv memcached [ebuild R ] net-misc/memcached-1.4.5 USE="-debug -sasl -slabs-reassign -test" 0 kB host ~ # emerge memcached
Configuring memcached
Memcached configuration file lives in /etc/conf.d/memcached.
Here's a reasonable example, 1GiB on internal network only.
MEMCACHED_BINARY="/usr/bin/memcached"
MEMUSAGE="1024"
MEMCACHED_RUNAS="memcached"
MAXCONN="2048"
LISTENON="10.101.105.109"
PORT="11211"
UDPPORT="${PORT}"
PIDBASE="/var/run/memcached/memcached"
Configure memcached to start on boot & start it now.
host ~ # rc-update -a memcached host ~ # /etc/init.d/memcached start
Tuning memcached
This is a larger subject than can be covered here but methods include:
- Using persistent connections
- Using special expirations for long persisting objects - in some cases 24h (or more) is acceptable
- Using Multiple memcached Segements and/or Servers


Visitor Maps