wecenter开启memcache的方法

2.0dev版本支持memcached配置,并优化了全局缓存系统,目前memcached的命中率基本上都在90%以上,能够有效降低服务器数据库的压力。对应开启的开关在/system/core/cache.php文件private $b...

2.0dev版本支持memcached配置,并优化了全局缓存系统,目前memcached的命中率基本上都在90%以上,能够有效降低服务器数据库的压力。对应开启的开关在/system/core/cache.php文件

private $backendName = 'File';
private $backendOptions = array(
/*
// Memcache 配置
'servers' => array(
array(
'host' => '127.0.0.1', 
'port' => 41111, 
'persistent' => true,
'timeout' => 5,
'compression' => false,	// 压缩
'compatibility' => false	// 兼容旧版 Memcache servers
)	
)
*/
);


改为

private $backendName = 'Memcached';
private $backendOptions = array(
// Memcache 配置
'servers' => array(
array(
'host' => '您的memcached服务器', 
'port' => memcached端口, 
'persistent' => true,
'timeout' => 5,
'compression' => false,	// 压缩
'compatibility' => false	// 兼容旧版 Memcache servers
)	
)
);


实时查看状态:


输入命令:

watch '/xxx/php/bin/php -r '"'"'$m=new Memcache;$m->connect("127.0.0.1", 11211);print_r($m->getstats());'"'"


或者

直接 telnet 到 127.0.0.1 的端口 11211 ,输入 stats ,回车,即可看到结果。telnet 到 memcached 之后,还有很多命令可以使用,可参考文档。

  • 发表于 2017-08-04 23:05
  • 阅读 ( 723 )
  • 分类:其他

条评论

请先 登录 后评论
不写代码的码农
三叔

66 篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除