【memcached】可视化memcache监控工具memcachephp安装与使用

# 一、背景

对于memcache监控,一般可以利用memcache自带的STAT命令来查看,但是其输出的结果对于开发而言不是很明了,监控的目的是让开发通过监控的结果去调优程序。

memcache也有一款图形界面的监控工具(memcachephp),可以通过这个工具查看到局域网内所有部署memcache机器或者端口的memcache的运行情况,对我们监控memcache的缓存命中率、cache利用率、点击率等信息有很好的帮助作用。

图形界面工具的推出,有助于我们性能测试工程师脱离命令行方式,避免多个memcache端口的监控窗口来回切换,更能够让测试人员有足够多的时间去做其他方面的工作。


# 二、安装

http://pecl.php.net/package/memcache
![image.png](https://upload-images.jianshu.io/upload_images/12979420-0a9e90d91c7035bf.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

yum  -y  install zlib-*  zlib*
yum  -y  install libevent
yum  -y  install  httpd   php 


wget https://pecl.php.net/get/memcache-2.2.7.tgz
tar -zxf  memcache-2.2.7.tgz
cp  memcache-2.2.7/memcache.php   /var/www/html/


vim   /var/www/html/memcache.php
修改 `memcache.php` 文件,这里需要修改如图A/B两处

![image.png](https://upload-images.jianshu.io/upload_images/12979420-4ebe11703d3919e8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)


A处修改: 这里其实也可以采用默认的账号密码,但是建议修改为自己的账号密码
B处修改: 这里是添加你需要的memcache主机,通过 $MEMCACHE_SERVERS[]可以配置多个memcache实例去监控


 systemctl restart httpd
 systemctl status  httpd

![image.png](https://upload-images.jianshu.io/upload_images/12979420-83765a2ec78aa59c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

# 三、展示效果
访问:  http://xx.xxx.xx.xx/memcache.php

![image.png](https://upload-images.jianshu.io/upload_images/12979420-de8c8c383f408018.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)


![image.png](https://upload-images.jianshu.io/upload_images/12979420-2b049d8433f18f1a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

![image.png](https://upload-images.jianshu.io/upload_images/12979420-5ef057867ab03886.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

# 四、参考

Memcache - 一款图形化memcache监控工具
https://www.cxyzjd.com/article/eaglecolin/53843136


Memcached管理与监控工具 MemAdmin
https://linux.cn/article-668-1.html


MemAdmin,基于 PHP5 & JQuery 的 Memcached 管理监控工具
http://www.junopen.com/memadmin/

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值