我在云中有自己的虚拟服务器,运行nginx和APC。 在这个服务器上,我有一个使用W3TC插件的WordPress博客。 我使用APC启用了页面caching和对象caching。
当访问首页,页面和post来自服务器的响应几乎立即。 但是在search时,响应需要1秒钟。
我想知道是否有可能使响应更快。
使用debugging查询WP插件我已经分析了searchSQL查询,它只需要0.002完成。 根据W3TC的大部分对象被caching。 事实上,Debug Queries插件给出了以下关于search结果的报告:
Total query time: 0,01482s for 120 queries. Page generated in 0,00000s, 0,00% PHP, 0,00% MySQL
所以看起来好像页面生成得非常快。 但是服务器的响应仍然需要1秒钟才能完成。
即使页面生成速度很快,我怎样才能知道它是什么让响应花费很长时间?
注:我只是谈论从服务器的响应时间,而不是在浏览器中生成页面的时间。
以下是我的网站的示例search结果 。
这是我目前的php-fpmconfiguration: http : //snipt.org/AiHg7
# tail /var/log/php5-fpm.log [05-Oct-2013 20:20:04] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 8 total children [07-Oct-2013 10:44:55] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 7 total children [08-Oct-2013 10:20:05] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 7 total children # ps aux | grep php root 1251 0.0 0.1 398732 1328 ? Ss May28 6:38 php-fpm: master process (/etc/php5/fpm/php-fpm.conf) www-data 15678 0.0 1.9 458804 20296 ? S Jul17 0:13 php-fpm: pool www www-data 18337 3.5 9.5 411072 98300 ? S 14:15 0:57 php-fpm: pool www www-data 18732 2.6 10.9 426648 112268 ? S 14:20 0:34 php-fpm: pool www www-data 19504 3.4 9.4 415556 97088 ? S 14:30 0:24 php-fpm: pool www root 20433 0.0 0.0 7548 828 pts/0 S+ 14:41 0:00 grep php
安装并configurationVarnish并在您的WordPress博客之前使用它。
考虑使用search插件。 狮身人面像search应该让你<1search。
http://wordpress.org/plugins/wordpress-sphinx-plugin/
WordPress的Sphinx Search Plugin允许使用Sphinx Search Server的function,在基于WordPress的网站上实现超快速和function丰富的search。
狮身人面像是一个开源的全文search服务器,devise从性能,相关性(又名search质量)和集成简单的头脑。 它是用C ++编写的,适用于Linux(RedHat,Ubuntu等),Windows,MacOS,Solaris,FreeBSD和其他一些系统。