Memcache常用管理命令

6 篇文章 0 订阅

  • 使用nc来连接memcached:

 nc 127.0.0.1 11211

stats
STAT pid 12116
STAT uptime 11407630
STAT time 1367896538
STAT version 1.2.6
STAT pointer_size 32
STAT rusage_user 85.714969
STAT rusage_system 234.852297
STAT curr_items 18394
STAT total_items 1605921
STAT bytes 20144115
STAT curr_connections 35
STAT total_connections 792502
STAT connection_structures 140
STAT cmd_get 5607557
STAT cmd_set 1605921
STAT get_hits 4874875
STAT get_misses 732682
STAT evictions 0
STAT bytes_read 2578556688
STAT bytes_written 11713360740
STAT limit_maxbytes 134217728
STAT threads 1
END



  • 常用的管理命令如下:


Command Description Example
get Reads a value get mykey
set Set a key unconditionally set mykey 0 60 5
add Add a new key add newkey 0 60 5
replace Overwrite existing key replace key 0 60 5
append Append data to existing key append key 0 60 15
prepend Prepend data to existing key prepend key 0 60 15
incr Increments numerical key value by given number incr mykey 2
decr Decrements numerical key value by given number decr mykey 5
delete Deletes an existing key delete mykey
flush_all Invalidate specific items immediately flush_all
Invalidate all items in n seconds flush_all 900
stats Prints general statistics stats
Prints memory statistics stats slabs
Prints memory statistics stats malloc
Print higher level allocation statistics stats items
stats detail
stats sizes
Resets statistics stats reset
version Prints server version. version
verbosity Increases log level verbosity
quit Terminate telnet session quit

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值