Categories
System/Linux/Unix*

一次啟動 5 個 memcached 的 shell

[code language=sh]

#!/bin/sh
IP=”192.168.1.254″
MEM=128
CONN=1024
PORTS=”11211 11212 11213 11214 11215″
#
for P in $PORTS; do
  PID=”/tmp/$P.pid”
  echo /usr/bin/memcached -u nobody -p $P -l $IP -d -m $MEM -c $CONN -P $PID
  /usr/bin/memcached -u nobody -p $P -l $IP -d -m $MEM -c $CONN -P $PID
done
#
echo “done!”

[/code]