是centos 5.5 32位、apache2.2、php5.3x、mysql5.x.
php是以模块形式在APACHE跑的,这种情况出现的时候:
1、WORDPRESS访问速度正常。
2、程序任何控制器、包括后台全卡着不动。
3、偶尔出现,正常情况下0.00x 执行时间
4、free -m 内存占用没有显著提升
新程序,100多条数据,在国外的服务器,之前以为是服务器卡,结果发现其他程序很稳定。
性急开了 system.php 中的 DEBUG,吓到我了:
Escape time: 224.35526895523, 17 queries, PHP Memory usage: 3388.21875 KB, Server time: 2012-12-21 02:03:27
神奇的是,DEBUG输出的所有SQL语句、CROND 都看不出执行时间有问题,而这种情况只是偶尔出现并非所有时间。
怀疑是国外服务器访问国内某服务器速度过慢导致的。。
Plugins:
Database
[Log time: 1356028072.5381] [Expend time: 0.0086970329284668] Connect Master DB
[Log time: 1356028072.5444] [Expend time: 0.0013711452484131] SELECT `system_setting`.* FROM `system_setting`
[Log time: 1356028072.5498] [Expend time: 0.0012779235839844] SELECT MEM., MEB. FROM users AS MEM LEFT JOIN users_attrib AS MEB ON MEM.uid = MEB.uid WHERE MEM.uid = 1
[Log time: 1356028072.551] [Expend time: 0.0008389949798584] SELECT `users_group`.* FROM `users_group` WHERE (group_id = 1) LIMIT 1
[Log time: 1356028072.5541] [Expend time: 0.00067901611328125] SELECT `nav_menu`.* FROM `nav_menu` ORDER BY `sort` ASC
[Log time: 1356028072.5553] [Expend time: 0.00063490867614746] SELECT `category`.* FROM `category` WHERE (id IN (1,2,8,9))
[Log time: 1356028072.5577] [Expend time: 0.00070691108703613] SELECT `category`.* FROM `category` WHERE (`type` = 'question') ORDER BY `sort` ASC, `id` ASC
[Log time: 1356028072.5596] [Expend time: 0.001255989074707] SELECT `users`.* FROM `users` WHERE (uid <> 1 AND last_active > 1353436072) ORDER BY `answer_count` DESC LIMIT 20
[Log time: 1356028072.5605] [Expend time: 0.00051999092102051] SELECT `cache`.* FROM `cache` WHERE (`key` = 'topic_get_hot_topic__5') LIMIT 1
[Log time: 1356028072.5618] [Expend time: 0.00089597702026367] SELECT `feature`.* FROM `feature` ORDER BY `id` DESC LIMIT 5
[Log time: 1356028072.5677] [Expend time: 0.002377986907959] SELECT `question`.* FROM `question` ORDER BY `update_time` DESC LIMIT 30
[Log time: 1356028072.5705] [Expend time: 0.00089192390441895] SELECT last_answer FROM question WHERE question_id IN (193,192,191,190,189,188,187,186,185,184,183,182,181,180,179,178,177,176,175,174,173,172,171,170,169,168,167,166,165,164)
[Log time: 1356028072.572] [Expend time: 0.0012478828430176] SELECT `answer`.* FROM `answer` WHERE (answer_id IN (406,408,409,410,411,413,414,418,420,421,422,424,425,426,427,431,433,435,439,441,442,443,451,453,454,455,456,462,464,465))
[Log time: 1356028072.5729] [Expend time: 0.00066304206848145] SELECT `category`.* FROM `category` WHERE (`type` = 'question') ORDER BY `id` ASC
[Log time: 1356028072.5744] [Expend time: 0.0014760494232178] SELECT MEM., MEB. FROM users AS MEM LEFT JOIN users_attrib AS MEB ON MEM.uid = MEB.uid WHERE MEM.uid IN(7,5,8,4,6,9,16,2,3,1)
[Log time: 1356028072.5756] [Expend time: 0.0010330677032471] SELECT topic.*, topic_question.question_id FROM topic AS topic LEFT JOIN topic_question AS topic_question ON topic_question.topic_id = topic.topic_id WHERE topic_question.question_id IN (193,192,191,190,189,188,187,186,185,184,183,182,181,180,179,178,177,176,175,174,173,172,171,170,169,168,167,166,165,164)
[Log time: 1356028072.5764] [Expend time: 0.00069713592529297] SELECT `category`.* FROM `category`
Crond
[Log time: 1356028072.5447] Tag: second, Last run time: 2012-12-21 02:27:40
[Log time: 1356028072.5447] Tag: half_minute, Last run time: 2012-12-21 02:27:37
[Log time: 1356028072.5447] Tag: minute, Last run time: 2012-12-21 02:27:37
[Log time: 1356028072.5447] Tag: week, Last run time: 2012-12-17 00:10:18
[Log time: 1356028072.5447] Tag: day, Last run time: 2012-12-21 00:53:42
[Log time: 1356028072.5447] Tag: hour, Last run time: 2012-12-21 01:56:27
[Log time: 1356028072.5447] Tag: half_hour, Last run time: 2012-12-21 02:02:44
Escape time: 231.02664399147, 17 queries, PHP Memory usage: 3388.21875 KB, Server time: 2012-12-21 02:27:52
阅读全文
收起全文