Memcached查看和清理

1.一种

telnet localhost 11211 #登陆

stats #查看状态

flush_all #清理

quit #退出

2.又学到一个:

echo 'flush_all' | nc localhost 11211

3.

1、数据存储(假设key为test,value为12345)

printf "set test 0 1 5\r\n12345\r\n" | nc localhost 11211

STORED

2.数据取回(假设key为test)

printf "get test\r\n" | nc localhost 11211

VALUE test 0 5

12345

 END

 3.数据增加1(假设key为test并且value为正整数)

 printf "incr test 1\r\n" | nc localhost 11211

123456

 4.数值减少3(假设key为test,并且value为正整数)

printf "decr test 3\r\n" | nc localhost 11211

5.数据删除(假设key为test)

printf "delete test\r\n" | nc localhost 11211

DELETED

 6.查看Memcached状态

 printf "stats\r\n" | nc localhost 11211

 7.模拟top命令,查看Memcached状态:

printf "stats\r\n" |nc localhost 11211

或者
watch "echo stats |nc localhost 11211"

posted @ 2011-12-10 17:31  瑞尼书苑  阅读(325)  评论(0编辑  收藏  举报