命令行查看Memcached运行状态&状态解释

http://hi.baidu.com/hygrom/blog/item/387477f4e3179dd3f3d3852a.html

1.windows系统连接memcached端口 cmd命令行中键入telnet 127.0.0.1 11211 11211是memcached绑定的端口号。

note: from envykok

figure1:



2.连接上端口后输入 stats命令,即可得到描述Memcached服务器运行情况的参数。

note:from envykok

figure 2:


STAT pid 4356 服务器进程ID
STAT uptime 56625 服务器运行时间,单位秒
STAT time 1225249079 服务器当前的UNIX时间
STAT version 1.1.0 服务器的版本号
STAT pointer_size 64
STAT rusage_user 151.845489 该进程累计的用户时间(秒:微妙)
STAT rusage_system 121.667603 该进程累计的系统时间(秒:微妙)
STAT ibuffer_size 4096
STAT curr_connections 13 连接数量
STAT total_connections 54136 服务器运行以来接受的连接总数
STAT connection_structures 318 服务器分配的连接结构的数量
STAT cmd_get 100595 取回请求总数
STAT cmd_set 6510 存储请求总数
STAT get_hits 96543 请求成功的总次数
STAT get_misses 4052 请求失败的总次数
STAT bytes_read 4427679 服务器从网络读取到的总字节数
STAT bytes_written 6585596 服务器向网络发送的总字节数

1>、uptime 是memcached运行的秒数,
2>、cmd_get是查询缓存的次数。
3>、这两个数据相除一下就能得到平均每秒请求缓存的次数——最近niupu的流量很低,所以平均也就一秒请求一次多,
    这么点大的压力,用文件系统缓存一样没问题,根本不会体现出使用memcached的优越。
4>、下面的cmd_set 就是设置key=>value的次数。整个memcached是个大hash,用cmd_get没有找到的内
    容,就会调用一下cmd_set写进缓存里。
5>、紧跟着是get_hits,就是缓存命中的次数。缓存命中率 = get_hits/cmd_get * 100%。
6>、下面的get_misses的数字加上get_hits应该等于cmd_get。
7>、而total_itemscurr_items表示现在在缓存中的键值对个数.
8>、在图上total_items == cmd_set == get_misses,不过当可用最大内存用光时,memcached就会删掉一些内容,上面的等式就不成立了。

 

note: from envykok

退出telnet,

quit
figure 3:





Note:
http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt
Name              Type     Meaning
----------------------------------
pid               32u      Process id of this server process
uptime            32u      Number of seconds this server has been running
time              32u      current UNIX time according to the server
version           string   Version string of this server
pointer_size      32       Default size of pointers on the host OS
                           (generally 32 or 64)
rusage_user       32u:32u  Accumulated user time for this process
                           (seconds:microseconds)
rusage_system     32u:32u  Accumulated system time for this process
                           (seconds:microseconds)
curr_items        32u      Current number of items stored by the server
total_items       32u      Total number of items stored by this server
                           ever since it started
bytes             64u      Current number of bytes used by this server
                           to store items
curr_connections  32u      Number of open connections
total_connections 32u      Total number of connections opened since
                           the server started running
connection_structures 32u  Number of connection structures allocated
                           by the server
cmd_get           64u      Cumulative number of retrieval requests
cmd_set           64u      Cumulative number of storage requests
get_hits          64u      Number of keys that have been requested and
                           found present
get_misses        64u      Number of items that have been requested
                           and not found
evictions         64u      Number of valid items removed from cache                                                                          
                           to free memory for new items                                                                                      
bytes_read        64u      Total number of bytes read by this server
                           from network
bytes_written     64u      Total number of bytes sent by this server to
                           network
limit_maxbytes    32u      Number of bytes this server is allowed to
                           use for storage.
threads           32u      Number of worker threads requested.
                           (see doc/threads.txt)



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值