0

My CI app has been working well so far.

However I noticed that when a longer SQL query is requested (for example on the home page where around 50 blog posts are shown) there is a serious problem.

Sometimes the page loads fine. Unpredictably, as I reload that same page - with no change in content - the browser keeps hanging until I get back an Apache 500 error. This happens on multiple browsers.

CI error logs show nothing. PHP error logs show nothing.

I've noticed this is not an issue with smaller queries (ie, 20 posts), but am unsure if it has anything to do with the problem, after all, it does download 50 posts on some attempts.

I know this is hard to explain in detail, but if anyone could give me any pointers on how to debug I'd be very grateful. Glad to add any info.

The app is running on a Plesk 9 RHEL server, PHP 5.3.8, MySQL 5.5.17, CI 2.1.0.

php error log file

-rw-rw-r-- 1 apache       apache              0 May 19 10:46 php_errors.log

php.ini info

error_log   /var/log/php_errors.log /var/log/php_errors.log
log_errors  On                      On
4

1 回答 1

0

在这里使用火花调试工具栏:http: //getsparks.org/packages/Debug-Toolbar/versions/HEAD/show

然后观察你的查询加载的时间,查看你的内存等。慢慢地将你的帖子数从 20 增加到 30 到 50 到 100 等,直到发生错误 - 看看是否有什么问题。

我怀疑发生了 PHP 超时,要么是因为您将超时值配置为低(应该在 230 左右),要么是您的查询写得非常糟糕且效率低下,导致服务器需要很长时间才能使用更大的查询返回结果.

于 2012-05-19T21:40:24.453 回答