loading...

Tag: 缓存

linux下memcache优化wordpress详解二(wordpress优化)

传送门(memcache 安装):http://wlog.com.cn/xhtml/linux-memcache-install.html

服务器上安装memcache成功后,现在开始配置wordpress!

1、检查wordpress中wp-config.php,下载最新Memcached-for-wordpress插件

http://plugins.trac.wordpress.org/browser/memcached/trunk

修该连接信息:默认为 `127.0.0.1:11211`,修改为你的服务器ip和相应端口

2、复制object-cache.php到wp-content目录下即可!

通过memcached监控程序查看缓存区使用情况 ,缓存命中率

可以通过在wordpress主题文件底部加以下代码查看数据库查询次数,:

<?php timer_stop(1); ?>  秒钟有 < ?php echo get_num_queries(); ?>

查询次数是不是减少了?

enjoy it!

linux下memcache优化wordpress详解一(memcache安装)

1、安装libevent:

下载地址:http://monkey.org/~provos/libevent/

安装位置:/usr/local/libevent (根据自己喜好而定,建议外部程序库都装到/usr/local对应的目录下)

安装过程:

#下载解压
$ wget http://monkey.org/~provos/libevent-1.4.13-stable.tar.gz
(请在安装时选择最新稳定版http://monkey.org/~provos/libevent/)
$ tar -xvf libevent-1.4.13-stable.tar.gz
$ cd libevent-1.4.13-stable
#安装
$ ./configure --prefix=/usr/local/libevent
$ make
$ make install

查看全部安装过程

Page 1 of 11