Memcached命令大全之stats
stats命令
查询服务器的运行状态和其他内部数据,包含如下这些:
- pid :服务器进程 ID
- uptime :服务器运行时间,单位秒
- time:服务器当前的 UNIX 时间
- version :服务器的版本号
- libevent:libevent的版本
- pointer_size :服务器操作系统位数
- rusage_user:该进程累计的用户时间
- rusage_system:该进程累计的系统时间
- curr_connections :当前连接数
- total_connections :服务器启动后总连接数
- connection_structures :服务器分配的连接结构的数量
- reserved_fds:内部使用的misc fds 数量
- cmd_get :获取请求数量
- get_hits :获取成功的总次数,命中次数
- get_misses :获取失败的总次数
- cmd_set :存储请求数量
- cmd_flush :flush请求的数量
- cmd_touch:touch请求的数量
- delete_misses :删除失败次数
- delete_hits :删除命中
- incr_misses :递增失败次数
- incr_hits :递增命中次数
- decr_misses :递减命中次数
- decr_hits :递减失败次数
- cas_misses :Cas 原子设置操作失败次数
- cas_hits :Cas 命中次数
- cas_badval :Cas 操作找到 key, 但是版本过期,没有设置成功
- touch_hits:touch命中次数
- touch_misses:touch失败次数
- auth_cmds :认证次数(包括成功和失败)
- auth_errors :认证失败次数
- bytes :已用缓存空间
- bytes_read :总共获取的数据量
- bytes_written :总写入数量数
- limit_maxbytes :总允许写入的数据量,和分配的内存有关
- accepting_conns:允许的总连接数
- listen_disabled_num :监听失败的次数
- threads:需要的工作线程数
- hash_bytes:当前使用的Hash table容量大小
- hash_is_expanding:指定Hash table是否自动增长
- malloc_fails:malloc内存分配失败的次数
- curr_items :当前缓存 item 数量
- total_items :从服务启动后,总的存储缓存 item 数量
- evictions :通过删除 item 释放内存的次数
这些数据隐含的几个基本关系:
- 缓存命中率 = get_hits/cmd_get * 100%
- get_misses的数字加上get_hits应该等于cmd_get