简体   繁体   English

在每个请求上Drupal 7的页面加载缓慢

[英]Drupal 7 slow page load on every request

I have problem with drupal 7 installation (I have it locally on my PC). 我在安装drupal 7时遇到问题(我在PC上本地安装了它)。 The page loads very slowly on every request, I have enabled Slow Queries Log and this is the output: 该页面在每个请求上的加载速度都很慢,我启用了慢速查询日志,这是输出:

"Executed 626 queries in 300.88 ms. Queries exceeding 5 ms are highlighted. Page execution time was 15795.26 ms. Memory used at: devel_boot()=3.01 MB, devel_shutdown()=88.32 MB, PHP peak=92 MB." “在300.88毫秒内执行了626条查询。突出显示了超过5毫秒的查询。页面执行时间为15795.26毫秒。内存用于:devel_boot()= 3.01 MB,devel_shutdown()= 88.32 MB,PHP peak = 92 MB。”

Some more info: 更多信息:

The number of queries varies each request from 300-1000 ! 每个请求的查询数量在300-1000之间变化!

15sec. 15秒 and sometimes even more up to 70-90 seconds (but rarely) ! 有时甚至长达70-90秒(但很少)!

I have disabled the cron via "admin/config/system/cron" page. 我已经通过“ admin / config / system / cron”页面禁用了cron。

Please help! 请帮忙!

Start disabling custom modules you have one by one to see which is working slow. 开始逐个禁用自定义模块,以查看运行缓慢的模块。 Also you can check admin/reports/status for hints, what is wrong with your Drupal instance. 您也可以检查admin / reports / status以获取提示,Drupal实例出了什么问题。

If you deleted folder with some module without disabling that module, drupal trying to find that lost folder. 如果删除了某个模块的文件夹而未禁用该模块,则drupal尝试查找该丢失的文件夹。

  1. Return deleted module's folder 返回删除的模块的文件夹
  2. Disable module 禁用模块
  3. Delete folder again 再次删除文件夹

First thing that matter for Drupal site performances is OS. 对于Drupal站点性能而言,第一件事是操作系统。

It is very important which OS you use on local machine. 在本地计算机上使用哪个操作系统非常重要。 Drupal works better on UNIX based systems. Drupal在基于UNIX的系统上效果更好。 For hosting Drupal site you should go with Linux platform. 要托管Drupal网站,您应该使用Linux平台。 For developing go with Mac OS and go with Windows if you have no other choice. 如果没有其他选择,则可以使用Mac OS和Windows进行开发。

Second thing is your hardware. 第二件事是您的硬件。

You should know that you must have decent hardware for good response of Drupal site on local machine. 您应该知道,您必须具有适当的硬件才能在本地计算机上获得Drupal站点的良好响应。 Average Drupal site using about 30-50 enabled modules and runs around 100-200 queries per page load. 一般的Drupal网站使用大约30-50个启用的模块,每页加载运行大约100-200个查询。 More complex site will rune slower and there are many ways to optimize performance of your Drupal site but that is whole another topic. 更复杂的站点运行速度较慢,并且有很多方法可以优化您的Drupal站点的性能,但这是另一个主题。

Third thing is type of modules you using. 第三件事是您使用的模块类型。

Performance of your site is directly related with your enabled modules. 您网站的性能与您启用的模块直接相关。 Number of modules is important but it is also important what type are these modules. 模块数量很重要,但是这些模块的类型也很重要。 For instance some modules are used only in developing process so when you finish with your developing you should disable them. 例如,某些模块仅在开发过程中使用,因此在完成开发后应禁用它们。 Math is simple. 数学很简单。 Using modules which are more complex will give you performance penalty. 使用更复杂的模块会降低性能。

Things you should do: 您应该做的事情:

  1. Check updates for your Drupal core and your modules 检查您的Drupal核心和模块的更新
  2. Update your core and modules with the latest releases 使用最新版本更新您的核心和模块
  3. Run /update.php script 运行/update.php脚本
  4. Disable developing modules and all other modules you don't need (most common modules which result some performance loss are: update manager, views UI, devel...) 禁用开发模块和所有不需要的模块(导致性能下降的最常见模块是:更新管理器,视图UI,开发...)
  5. Set up cron tasks only based on your needs 仅根据您的需要设置cron任务
  6. If you still have problems with your performances considering all above you should go on drupal.org support forums and ask for help with specific details of your problem 如果您仍然考虑到以上所有方面的问题,请继续访问drupal.org支持论坛,寻求有关问题具体细节的帮助。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM