我使用 pingdom 检查网站的加载时间。我发现了一些来自其他领域的瓶颈并修复了它们。但最慢的部分仍然存在。
主页几乎在 12 秒内打开!一秒钟来自所有内部和外部的 js、css 和 jpeg 文件。11秒来自主页。pingdom 结果中我的主页的详细信息:
DNS 157 ms
Connect 213 ms
Send 0 ms
Wait 10.5 s
Receive 56 ms
我将 tic-toc 放在主页控制器的 beforeFilter 和 afterFilter 中。我在一小时内运行了很多次。结果是主页在 0.15 到 0.35 秒之间加载。
我 ping 我的服务器并得到 70 毫秒的结果。
我还能做些什么来诊断这种延迟?
谢谢
编辑:您可以从此链接查看结果
Edit2:我的应用程序似乎运行了 0.35 秒。(主页甚至没有数据库查询)但我可以在 10-11 秒内在浏览器上看到结果。是因为访客负载吗?此时是否有太多访问者正在使用该网站?
Edit3:我仍然遇到这个问题。我发现服务器的error_log有太多的记录,如下所示。我希望这会提供一些信息:
Line 384: 2012-09-02 17:39:47.505 [INFO] [92.45.160.177:51491-0#APVH_example.com] connection to [/tmp/lshttpd/APVH_example.com_Suphp.sock.230] on request #361, confirmed, 0, associated process: 705101, running: 1, error: Connection reset by peer!
Line 385: 2012-09-02 17:41:16.223 [INFO] [78.162.236.209:28170-0#APVH_example.com] connection to [/tmp/lshttpd/APVH_example.com_Suphp.sock.671] on request #78, confirmed, 0, associated process: 705246, running: 0, error: Connection reset by peer!
Line 387: 2012-09-02 17:57:15.455 [INFO] [109.228.230.250:54280-0#APVH_example.com] connection to [/tmp/lshttpd/APVH_example.com_Suphp.sock.412] on request #92, confirmed, 0, associated process: 709770, running: 0, error: Connection reset by peer!
Line 388: 2012-09-02 17:58:24.008 [INFO] [95.65.209.252:64082-0#APVH_example.com] connection to [/tmp/lshttpd/APVH_example.com_Suphp.sock.858] on request #500, confirmed, 0, associated process: -1, running: 0, error: Connection reset by peer!
Line 395: 2012-09-02 18:14:53.744 [INFO] [85.103.215.78:54135-0#APVH_example.com] connection to [/tmp/lshttpd/APVH_example.com_Suphp.sock.241] on request #460, confirmed, 0, associated process: 714360, running: 0, error: Connection reset by peer!
Line 401: 2012-09-02 18:34:22.476 [INFO] [78.173.185.165:14411-0#APVH_example.com] connection to [/tmp/lshttpd/APVH_example.com_Suphp.sock.728] on request #500, confirmed, 0, associated process: 720637, running: 1, error: Connection reset by peer!
Line 402: 2012-09-02 18:35:07.269 [INFO] [78.174.20.184:53766-0#APVH_example.com] connection to [/tmp/lshttpd/APVH_example.com_Suphp.sock] on request #26, confirmed, 0, associated process: 720626, running: 0, error: Connection reset by peer!
Line 404: 2012-09-02 18:49:57.659 [INFO] [85.96.10.138:59346-0#APVH_example.com] connection to [/tmp/lshttpd/APVH_example.com_Suphp.sock.728] on request #500, confirmed, 0, associated process: 724847, running: 0, error: Connection reset by peer!
Line 405: 2012-09-02 18:50:44.566 [INFO] [81.6.120.50:39926-0#APVH_example.com] connection to [/tmp/lshttpd/APVH_example.com_Suphp.sock.173] on request #500, confirmed, 0, associated process: 725035, running: 0, error: Connection reset by peer!
Line 413: 2012-09-02 19:15:28.953 [INFO] [78.181.128.53:1344-0#APVH_example.com] connection to [/tmp/lshttpd/APVH_example.com_Suphp.sock.738] on request #500, confirmed, 0, associated process: 731389, running: 1, error: Connection reset by peer!
Line 414: 2012-09-02 19:15:41.572 [INFO] [78.191.100.24:51095-0#APVH_example.com] connection to [/tmp/lshttpd/APVH_example.com_Suphp.sock] on request #500, confirmed, 0, associated process: 731344, running: 1, error: Connection reset by peer!
Line 417: 2012-09-02 19:33:09.700 [INFO] [78.165.162.13:65231-0#APVH_example.com] connection to [/tmp/lshttpd/APVH_example.com_Suphp.sock.317] on request #58, confirmed, 0, associated process: 736102, running: 0, error: Connection reset by peer!
Line 419: 2012-09-02 19:43:16.749 [INFO] [178.233.166.110:51083-0#APVH_example.com] connection to [/tmp/lshttpd/APVH_example.com_Suphp.sock.895] on request #128, confirmed, 0, associated process: 738842, running: 0, error: Connection reset by peer!