Defina uma variável adicional em /etc/sysconfig/memcached
:
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
LOGFILE="/var/log/memcached.log"
OPTIONS=""
Edite a função start()
no script de inicialização conforme abaixo:
start () {
#echo -n $"Starting $prog: "
# insure that /var/run/memcached has proper permissions
if [ "'stat -c %U /var/run/memcached'" != "$USER" ]; then
chown $USER /var/run/memcached
fi
#daemon --pidfile /var/run/memcached/memcached.pid memcached -d -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN -P /var/run/memcached/memcached.pid $OPTIONS -vv > $LOGFILE 2>&1
$prog -d -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN -P /var/run/memcached/memcached.pid $OPTIONS -vv > $LOGFILE 2>&1
RETVAL=$?
#echo
[ $RETVAL -eq 0 ] && action $"Starting $prog: " /bin/true && touch /var/lock/subsys/memcached
}
então reinicie o memcached, você verá algo parecido com isto no /var/log/memcached.log
:
slab class 40: chunk size 616944 perslab 1
slab class 41: chunk size 771184 perslab 1
slab class 42: chunk size 1048576 perslab 1
<26 server listening (auto-negotiate)
<27 server listening (auto-negotiate)
<28 send buffer was 129024, now 268435456
<29 send buffer was 129024, now 268435456
<28 server listening (udp)
<29 server listening (udp)
Não se esqueça de configurar o logrotate.