Memcache连接出错的问题今天一早突然发现Memcache连接不到了,检查了一下Memcache的服务发现很正常。??is tu
Memcache连接出错的问题
今天一早突然发现Memcache连接不到了,检查了一下Memcache的服务发现很正常。
?
?
is turned on automatically; if not, then it may be turned on
by sending the "stats detail on" command to the server.
-t <num> number of threads to use (default: 4)
-R Maximum number of requests per event, limits the number of
requests process for a given connection to prevent
starvation (default: 20)
-C Disable use of CAS
-b Set the backlog queue limit (default: 1024)
-B Binding protocol - one of ascii, binary, or auto (default)
-I Override the size of each slab page. Adjusts max item size
(default: 1mb, min: 1k, max: 128m)
-o Comma separated list of extended or experimental options
- (EXPERIMENTAL) maxconns_fast: immediately close new
connections if over maxconns limit
- hashpower: An integer multiplier for how large the hash
table should be. Can be grown at runtime if not big enough.
Set this based on "STAT hash_power_level" before a
restart.
?
?
memcached -d -m 256 -u root -l 10.1.106.20 -p 11211 -c 1024 -P /tmp/memcached.pid
?
-d选项是启动一个守护进程,
?
-m是分配给Memcache使用的内存数量,单位是MB,这里是200MB
-u是运行Memcache的用户,如果当前为 root 的话,需要使用此参数指定用户。
-l是监听的服务器IP地址,如果有多个地址的话,我这里指定了服务器的IP地址192.168.1.91
-p是设置Memcache监听的端口,我这里设置了12301,最好是1024以上的端口
-c选项是最大运行的并发连接数,默认是1024,这里设置了256
-P是设置保存Memcache的pid文件,我这里是保存在 /tmp/memcached.pid
停止Memcache进程:直接kill 进程号 或者?kill `cat /tmp/memcached.pid`
查看启动的memcache服务:netstat -lp | grep memcached?或者?ps -ef | grep memcached?