我正在使用一个名为feedwordpress 为了在wordpress上运行一个类似行星的网站(请参见here).
这个插件非常棒,除了一件事——它会占用我的(VPS)服务器,每周提交一次。
在最近与webadmin的电子邮件交流中,他写道:
看起来mysql资源使用量的增加是由r-bloggers运行的查询速度慢造成的。com。这是正在生成的一些日志的副本。您需要进一步优化此网站和数据库,以使其尽可能高效地运行。如果已经进行了这些更改,您最好的选择是考虑对VPS进行大规模升级,因为您的站点需要和看到高级别的资源和流量。
以下是日志:
# Time: 110614 16:11:35
# User@Host: rblogger_rblogr[rblogger_rblogr] @ localhost []
# Query_time: 104 Lock_time: 0 Rows_sent: 0 Rows_examined: 54616
SELECT SQL_CALC_FOUND_ROWS wp_rb_posts.* FROM wp_rb_posts WHERE 1=1 AND ((guid = \'235cbefa4424d0cdb7b6213f15a95ded\') OR (guid = \'http://www.r-bloggers.com/?guid=235cbefa4424d0cdb7b6213f15a95ded\') OR (guid = \'http://www.r-bloggers.com/?guid=235cbefa4424d0cdb7b6213f15a95ded\') OR (MD5(guid) = \'235cbefa4424d0cdb7b6213f15a95ded\')) AND wp_rb_posts.post_type IN (\'post\', \'page\', \'attachment\', \'revision\', \'nav_menu_item\') AND (wp_rb_posts.post_status = \'publish\' OR wp_rb_posts.post_status = \'future\' OR wp_rb_posts.post_status = \'draft\' OR wp_rb_posts.post_status = \'pending\' OR wp_rb_posts.post_status = \'trash\' OR wp_rb_posts.post_status = \'auto-draft\' OR wp_rb_posts.post_status = \'inherit\' OR wp_rb_posts.post_status = \'private\') ORDER BY wp_rb_posts.post_date DESC LIMIT 1570, 10;
# User@Host: rblogger_rblogr[rblogger_rblogr] @ localhost []
# Query_time: 237 Lock_time: 0 Rows_sent: 0 Rows_examined: 54616
SELECT SQL_CALC_FOUND_ROWS wp_rb_posts.* FROM wp_rb_posts WHERE 1=1 AND ((guid = \'235cbefa4424d0cdb7b6213f15a95ded\') OR (guid = \'http://www.r-bloggers.com/?guid=235cbefa4424d0cdb7b6213f15a95ded\') OR (guid = \'http://www.r-bloggers.com/?guid=235cbefa4424d0cdb7b6213f15a95ded\') OR (MD5(guid) = \'235cbefa4424d0cdb7b6213f15a95ded\')) AND wp_rb_posts.post_type IN (\'post\', \'page\', \'attachment\', \'revision\', \'nav_menu_item\') AND (wp_rb_posts.post_status = \'publish\' OR wp_rb_posts.post_status = \'future\' OR wp_rb_posts.post_status = \'draft\' OR wp_rb_posts.post_status = \'pending\' OR wp_rb_posts.post_status = \'trash\' OR wp_rb_posts.post_status = \'auto-draft\' OR wp_rb_posts.post_status = \'inherit\' OR wp_rb_posts.post_status = \'private\') ORDER BY wp_rb_posts.post_date DESC LIMIT 570, 10;
# Time: 110614 16:18:13
# User@Host: rblogger_rblogr[rblogger_rblogr] @ localhost []
# Query_time: 257 Lock_time: 0 Rows_sent: 0 Rows_examined: 54616
SELECT SQL_CALC_FOUND_ROWS wp_rb_posts.* FROM wp_rb_posts WHERE 1=1 AND ((guid = \'956e208f101562f6654e88e9711276e4\') OR (guid = \'http://www.r-bloggers.com/?guid=956e208f101562f6654e88e9711276e4\') OR (guid = \'http://www.r-bloggers.com/?guid=956e208f101562f6654e88e9711276e4\') OR (MD5(guid) = \'956e208f101562f6654e88e9711276e4\')) AND wp_rb_posts.post_type IN (\'post\', \'page\', \'attachment\', \'revision\', \'nav_menu_item\') AND (wp_rb_posts.post_status = \'publish\' OR wp_rb_posts.post_status = \'future\' OR wp_rb_posts.post_status = \'draft\' OR wp_rb_posts.post_status = \'pending\' OR wp_rb_posts.post_status = \'trash\' OR wp_rb_posts.post_status = \'auto-draft\' OR wp_rb_posts.post_status = \'inherit\' OR wp_rb_posts.post_status = \'private\') ORDER BY wp_rb_posts.post_date DESC LIMIT 570, 10;
# Time: 110614 16:19:02
# User@Host: rblogger_rblogr[rblogger_rblogr] @ localhost []
# Query_time: 83 Lock_time: 0 Rows_sent: 0 Rows_examined: 54616
SELECT SQL_CALC_FOUND_ROWS wp_rb_posts.* FROM wp_rb_posts WHERE 1=1 AND ((guid = \'6c589e661f03a67b0529fab2f080bfd3\') OR (guid = \'http://www.r-bloggers.com/?guid=6c589e661f03a67b0529fab2f080bfd3\') OR (guid = \'http://www.r-bloggers.com/?guid=6c589e661f03a67b0529fab2f080bfd3\') OR (MD5(guid) = \'6c589e661f03a67b0529fab2f080bfd3\')) AND wp_rb_posts.post_type IN (\'post\', \'page\', \'attachment\', \'revision\', \'nav_menu_item\') AND (wp_rb_posts.post_status = \'publish\' OR wp_rb_posts.post_status = \'future\' OR wp_rb_posts.post_status = \'draft\' OR wp_rb_posts.post_status = \'pending\' OR wp_rb_posts.post_status = \'trash\' OR wp_rb_posts.post_status = \'auto-draft\' OR wp_rb_posts.post_status = \'inherit\' OR wp_rb_posts.post_status = \'private\') ORDER BY wp_rb_posts.post_date DESC LIMIT 1440, 10;
这就引出了我的问题——日志中的哪些内容可能会向我表明发生了什么(为什么这样的查询需要这么长时间?)?是否可以优化这些?如果是,如何?
谢谢Tal