主要关注curr_items 和 get_hits :用get_hits 除以 curr_items 查看命中率有多高
命中率的目的,是要确认,memcached缓存了数据,而且还有请求,如果光缓存却没有请求,那么做这个缓存也就没有意义。
1. 查看memcached服务状态 :[root@hao-01 ~]# memcached-tool 127.0.0.1:11211 stats
关注的项: curr_items get_hits
2. 安装nc命令 :[root@hao-01 ~]# yum install -y nc
用cn命令查看memcached服务状态 :[root@hao-01 ~]# echo stats |nc 127.0.0.1 11211
关注的项 : curr_items get_hits
3. 安装libmemcached :[root@hao-01 ~]# yum install -y libmemcached
查看memcached服务状态 :[root@hao-01 ~]# memstat --servers=127.0.0.1:11211
关注的项 : curr_items get_hits