非常大的 Drupal 页面执行时间
我使用 dreamhost 进行 VPS 托管,并且页面加载时间非常长。这是 mysql 查询的 Devel 模块的输出。
Executed 190 queries in 227.67 milliseconds. Page execution time was 21969.43 ms.
使用模块分析 http://2bits .com/articles/measuring-memory-conspiration-by-drupal-bootstrap-and-modules.html 看起来没问题:
total: 304.15
因此,如果模块花费 304 毫秒而 mysql 花费 227 毫秒,那么其他 21 秒在哪里呢?要去吗?!
这是网址 http://5oup.net
一如既往,非常感谢任何帮助!
詹姆斯
I'm on VPS hosting with dreamhost and am experiencing very high page load times. Here is the output from Devel module for mysql queries.
Executed 190 queries in 227.67 milliseconds. Page execution time was 21969.43 ms.
Using the module profiling at http://2bits.com/articles/measuring-memory-consumption-by-drupal-bootstrap-and-modules.html it seems ok:
total: 304.15
So if the modules are taking 304ms and the mysql is taking 227ms, where could the other 21 seconds be going?!
Here is the url http://5oup.net
As always any help very much appreciated!
James
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您没有压缩 CCS 文件的 JavaScript,它不应该是页面加载如此缓慢的原因。看来您的站点设置为开发模式,这对于生产站点来说非常无效。
我试着浏览了一下,没有发现任何页面像你描述的那么慢。但上面这一点是性能提升的一个重点。
You are not compressing your JavaScript of CCS files, it shouldn't be the cause to such a slow page load. It seems that you have your site setup for development mode, which is quite ineffective for a production site.
I tried browsing around, and I didn't find any page that was as slow as you describe. But the point above is a major point for performance improvement.
主页上的一些临时测试为每个请求提供了大约 8-12 秒的时间(强制重新加载以排除本地缓存)。根据 firebug 的说法,最大的等待是由于加载所有图像进行旋转,紧随其后的是单独且未压缩的 css 和 js 文件。
使用本地缓存,该时间会减少到 1-4 秒,大部分时间都花在等待服务器对所有涉及的文件实际响应“304 - 未修改”。
因此,您的首要目标应该是减少单独文件的数量:
admin/settings/performance 下的站点设置
。您应该首先尝试 css/js 组合,然后看看是否真的需要更多调整。
Some ad hoc testing on the home page gives me about 8-12 seconds per request (forced reload to exclude local caching). According to firebug, the biggest waits are due to loading all the images for the rotation, closely followed by the separate and uncompressed css and js files.
With local caching, this goes down to 1-4 seconds, with most of the time being spent on waiting for the server to actually respond with a '304 - not modified' for all the files involved.
So your first goal should be reduction of the number of separate files:
admin/settings/performance
.You should try the css/js combination first and see if you really need more tweaking after that.
我发现主页上非常高的页面负载是由 simplexml_load_file() 引起的,由于某种原因,它在我的主机上没有启用。
I found the very high page load on the home page was down to simplexml_load_file(), which for some reason was not enabled on my host.