简体   繁体   English

Drupal开发:性能

[英]Drupal development: performance

as the single user / developer on a drupal website im experience serious performance problems. 由于Drupal网站上的单个用户/开发人员会遇到严重的性能问题。 several issues occur: 发生几个问题:

  • usually i develop drupal on our company dev server but now im at a client's office. 通常,我在我们公司的开发服务器上开发drupal,但现在在客户办公室。 the IT guys installed a VM with WAMP on the server they usually use for .net development. IT人员在通常用于.net开发的服务器上安装了带有WAMP的VM。 on the first day of dev (installing drupal, required modules and configuring them) httpd.exe would max out the cpu and loading any page would take minutes. 在开发的第一天(安装drupal,必需的模块并进行配置),httpd.exe将使CPU发挥最大作用,并且加载任何页面都需要几分钟。 IT guys just scratch their heads. IT人士只是scratch之以鼻。

  • i then just installed WAMP on the local machine they gave me: some 299,99 Win XP Dell piece of sh*t, nevertheless a P4 2.8Ghz 2GB Ram. 然后我只是在他们给我的本地计算机上安装了WAMP:一些299,99 Win XP Dell sh * t,不过是P4 2.8Ghz 2GB Ram。 the fan blows so loud the entire office is giving me dirty looks. 风扇吹得很大声,整个办公室让我看起来很脏。 Again httpd.exe maxes out. 再次httpd.exe最大化。 again, any page (esp admin ones) takes minutes to load 同样,任何页面(特别是管理员页面)都需要几分钟的时间来加载

  • in firefox, the views UI is completely unworkable. 在firefox中,视图UI完全不可行。 alot of stuff is loaded with ajax and it again takes minutes to see the various html elements dynamically inserted in the UI to appear - try to imagine this. ajax加载了很多东西,再次花几分钟才能看到动态插入到UI中的各种html元素出现-尝试想象一下。

  • Chrome seems to handle the JS a bit better but it still takes way too long to complete any kind of action. Chrome似乎对JS的处理要好一些,但是完成任何类型的操作仍需要花费很长时间。

  • the devel_themer module ads tons of markup to the page which leads to "Allowed memory size of X exhausted" errors (memory_limit = 128MB ). devel_themer模块将大量的标记添加到页面上,从而导致“允许X的内存大小用尽”错误(memory_limit = 128MB)。

now im at the themeing stage where i need to do a LOT of page refreshes. 现在我正处于主题化阶段,我需要刷新很多页面。 I NEED firebug which requires firefox which in its turn eats up CPU and RAM. 我需要firebug,它需要firefox,这又会占用CPU和RAM。 What usually takes seconds now takes minutes and by the time whatever action is completed, i forgot what i was doing. 现在通常需要几秒钟的时间现在要花费几分钟,到完成任何操作时,我都忘记了自己在做什么。 im basically reading news stories in between every page reload. 我基本上是在每次重新加载页面之间阅读新闻报道。

now, i know drupal is resource intensive but that its impossible to develop on a typical Dell / Win XP machine is a bit much, no? 现在,我知道drupal是资源密集型的,但是在典型的Dell / Win XP计算机上不可能开发它,这有点多,不是吗? at home i work on an iMac and everything runs silky smooth. 在家里,我使用iMac进行工作,一切运行起来都很流畅。

i cant imagine im the only guy with this problem since what im doing is basically drupal 101 (no custom modules so far ...). 我无法想象我是唯一有这个问题的人,因为我所做的基本上是drupal 101(到目前为止还没有自定义模块...)。 unless someone can offer a solution, im concluding that you basically can not develop a typical drupal site on a normal home desktop computer. 除非有人可以提供解决方案,否则就意味着您基本上不能在普通的家用台式计算机上开发典型的drupal网站。

what gives? 是什么赋予了?

So you have abandoned the VM,check you php.ini file for the memory limit, increase it and see if there is a performance boost. 因此,您已经放弃了VM,请检查php.ini文件中的内存限制,然后增加它并查看性能是否有所提高。 its usually set to a default of 16M. 它通常设置为默认值16M。

HTH 高温超导

I'd suggest you either make sure to spend some time actually tuning your XP system, because the default WAMP config is definitely suboptimal, or consider an alternative, like Zend Server community edition (ZCE). 我建议您要么确保花一些时间来实际优化XP系统,因为默认的WAMP配置肯定不是最佳选择,或者考虑使用替代方法,例如Zend Server社区版(ZCE)。 Although not completely free as in speech, it is free as in beer, and simply builds up on top of a better default config for Apache and MySQL. 尽管它不像语音那样完全免费,但它却像啤酒一样免费,只是建立在Apache和MySQL更好的默认配置之上。

Although less convenient than WAMP or ZCE since not bundled, a manual install of Apache 2.2 is also usually a good choice. 尽管没有捆绑在一起,但不如WAMP或ZCE方便,但是手动安装Apache 2.2通常也是一个不错的选择。

Also note that, that the way devel_themer works, it is constantly building files in your temp directory, meaning that unless that directory is cleaned regularly, files will accumulate and directory browses will become exceedingly slow. 还要注意, devel_themer工作方式是,它会不断在temp目录中构建文件,这意味着,除非定期清理该目录,否则文件会堆积并且目录浏览将变得非常慢。 Only a cron.php run will cause drupal to clean those files, for an up-to-date version of devel. 对于最新版本的devel,仅运行cron.php会导致drupal清除这些文件。 See my patch adding this cleanup at http://drupal.org/node/303443 http://drupal.org/node/303443上看到我的补丁添加了此清理

Finally, you mention Firebug, and you might be using the Drupal for Firebug module, which has known performance issues, apparently related to infinite recursion in some cases; 最后,您提到了Firebug,并且您可能正在使用Drupal for Firebug模块,该模块具有已知的性能问题,在某些情况下显然与无限递归有关; although recent versions are supposed to fix this problem. 尽管应该使用最新版本来解决此问题。 See for instance http://drupal.org/node/303443 参见例如http://drupal.org/node/303443

A couple things I've run into that could potentially help. 我遇到的几件事可能会有所帮助。

  1. Unless you actually need it, turn off Locale. 除非您真正需要它,否则请关闭“语言环境”。 It causes a ton of extra queries (at least the last time I looked into it, this may have changed) so if you're not using it then don't put the unnecessary load on your DB. 它会导致大量额外的查询(至少是我上次查看该查询时,它可能已更改),因此,如果您不使用它,则不要在数据库上施加不必要的负载。
  2. Just like on a regular development machine, make sure MySQL is properly tuned and configured. 就像在常规开发计算机上一样,请确保正确调整和配置MySQL。 This goes for any setup; 这适用于任何设置; local, development or production. 本地,开发或生产。 3/4 of the time the database is the bottleneck so start there. 3/4的时间是数据库的瓶颈,因此从那里开始。
  3. If you've got the devel module installed and enabled it should have a query log you can tell it to output at the bottom of the page, this should help you with number 2. 如果您已经安装并启用了devel模块,则应该有一个查询日志,您可以告诉它在页面底部输出,这对于编号2会有帮助。

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

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