【发布时间】:2012-03-05 20:21:12
【问题描述】:
当我的用户使用我的 CakePHP 应用程序时,我的 mysql 进程一直处于休眠状态。
这是一个问题,因为对该应用程序的访问在该用户的计算机上被冻结(无限期加载)。当一个用户的应用程序被冻结时,其他计算机上的用户似乎不会受到影响。为该特定用户清除此问题的唯一方法是重新启动服务器上的 apache 服务(这并不理想,因为我在此服务器上运行多个按钮应用程序)。
用户等待超过5分钟后出现这个错误,似乎是我们的代理服务器产生的。
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL: [no URL]
The following error was encountered:
Read Timeout
The system returned:
[No Error]
A Timeout occurred while waiting to read data from the network. The network or server may be down or congested. Please retry your request.
Your cache administrator is root.
我正在努力确定是什么导致查询“入睡”,因此修复它。
在我看来,问题可能出在三个选项中:
- MySQL
- CakePHP
- 阿帕奇
有什么想法吗?
我的SHOW PROCESSLIST查询结果如下:
ID User Host Database Command Time Status SQL query
Kill 330 instrument localhost:1267 instrument_2012 Sleep 5235 --- ---
Kill 331 pma localhost:1270 None Sleep 0 --- ---
Kill 332 root localhost:1271 mysql Query 0 --- SHOW PROCESSLIST
注意事项
- 我没有使用持久连接。
- 所有用户都通过 CakePHP 应用程序连接到数据库。
- 应用程序使用“instrument”作为用户名连接到数据库。
- 重启 mysql 服务(而不是 apache 服务)没有影响。
- CPU 使用率从冻结后的
编辑
我将在查询中检索到的记录数限制为 800 条,响应时间为 12 秒。当我检索 1200 条记录时,响应时间为 72 秒。当我检索 1600 条记录时,响应时间为 132 秒。
为什么响应时间增长如此之快?
【问题讨论】:
标签: mysql apache cakephp xampp