Depends what control do you want to have over individual memcache instances. For instance current init script reads entries in /etc/sysconfig/memcached that looks like this

PORT="11211"
USER="nobody"
MAXCONN="1024"
CACHESIZE="2800"
OPTIONS="-f 1.25 -U 11211"

which is sourced in /etc/init.d/memcached with this line

if [ -f /etc/sysconfig/memcached ];then
        . /etc/sysconfig/memcached
fi

So you can either

1. Copy /etc/init.d/memcached to /etc/init.d/memcached2. Create /etc/sysconfig/memcached2 with desired values and modify the init script to source it.

2. Add a loop in /etc/init.d/memcached that takes all the /etc/sysconfig/memcached* files, individually sources them and invokes memcached.

Hope that helps.

Vladimir

On Wed, 10 Feb 2010, eva2000 wrote:

How would one go about managing multiple memcached instances on the
same server for startup/shutdown and restarts ?

Currently have 2x load balanced web servers each with one memcached
instance using /etc/init.d/memcached, /usr/local/bin/start-memcached
and memcached.conf approach but this isn't setup for more than 1x
memcached instance.

How are you folks handling this for CentOS 5.x based system ?

Reply via email to