Drupal 5.x 站点显示 >每页消耗 550 MB 内存。如何加速 Drupal 5.x 网站

发布于 2024-09-06 21:38:36 字数 364 浏览 2 评论 0原文

我在 Drupal 5.x 中开发了一个网站,现在它已经完成并且工作正常,但速度非常慢。有时工作速度很快,但对于 imp 模块来说需要时间。

当我查看性能日志时,每页至少消耗 150 MB 的内存。这是最小值。大多数页面显示 550~700 MB 的消耗。

到现在为止我做了什么。

  • 启用 Javascript 聚合。
  • 页面缓存已启用。
  • 启用带宽优化。
  • 不断检查下检查慢查询日志。

我的问题是,这个应用程序中内存消耗的影响是什么/如何影响的。 Drupal 自动获取数据库和代码之间的所有关系。我只开发了一些模块。

有哪些提示/技巧可用于提高我的网站速度。

I developed a site in Drupal 5.x and now its done and working fine, but its very slow. Working fast some time, but for imp modules it takes time.

When I see the performance logs, its consuming my memory for 150 MB per page MINIMUM. This is the minimum. Most of the pages its shows 550~700 MB consumption.

What I did till now.

  • Javascript Aggregation Enabled.
  • Page caching Enabled.
  • Bandwidth Optimization Enabled.
  • Slow query log checked under constant check.

My question, what/how exectaly the memory consumption is imp in this application. Drupal automatically takes all the relation between DB and code. Only some few modules are developed by me.

What the the tips/tricks can be used to improve my site speed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

朱染 2024-09-13 21:38:36

150MB不会通过一些聚合、缓存调整等来固定。那只是调整。

您(似乎)的某个模块存在严重问题或配置错误。

如果您了解cachegrind、xdebug 等,请执行以下操作:

  1. 禁用所有贡献的模块。问题消失了吗?
  2. 如果是,请逐个模块启用它们。启用模块 X 会降低性能,这样您就可以找出模块 X 是什么。
  3. 如果您没有看到性能突然下降(或内存使用量增加),则可能是由于模块组合所致。在这种情况下,请尝试禁用和启用模块组。

请记住,单个站点上的 60 个模块已经算是相当多了。 100+被认为是一场噩梦。

如果这不起作用,或者您更喜欢更专业(然后试错)的方法,请尝试cachegrind。这将显示每个文件、每个例程的内存分析。您将需要cachegrind、Xdebug 和一个可视化cachegrind 输出的程序,例如kcachegrind(KDE,据报道也可以在Windows 上运行)。更多信息请参见: http://xdebug.org/docs/profiler

但我相信您会发现一个行为不当的模块,确定该模块将帮助您找到解决方案。
一个普通的 Drupal5 站点在 36M 内存下应该可以正常运行。

150MB will not be fixed with some aggregation, cache tuning and so on. That is only tweaking.

You (seem to) have a severe problem with one of your modules or a misconfiguration.

Here is what to do, if you are not known to cachegrind, xdebug and such:

  1. Disable all contributed modules. Problem gone?
  2. if yes, enable them module-by-module. Enabling module X will drop performance, this way you find out what module X is.
  3. If you don't see a sudden decrease in performance (or increase in memory usage) it can be due to a combination of modules. In that case, try out disabling and enabling groups of modules.

Remember, 60 modules on a single site is considered rather much. 100+ is considered a nightmare.

If that does not work, or if you prefer a more prefessional (then trial-error) method, try cachegrind. That will show per-file, per-routine memory profiling. You will need cachegrind, Xdebug and a program to visualise the cachegrind output, such as kcachegrind (KDE, reported to work on windows too). More here: http://xdebug.org/docs/profiler

But I am confident that you will find one module that is misbehaving, and that pinning down that module will get you to the solution.
A normal Drupal5 site should run just fine under 36M of memory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文