I’ve already covered some issues that you need to be aware of when hosting a Drupal project, in the previous article, My Drupal site is slow! What can I do? – Part 1. In this part, I’ll talk about a few ways you can help cure some of your performance problems without needing lots of low-level administration knowledge.
Firstly, the Devel module is your friend. Devel can help you find out where the prime offenders are in terms of any slow queries. Turn on the query logging in the settings page and check your query times and number of queries.
If you have lots of queries on certain pages, there are a few options you can consider, depending on your user base. If you have certain queries which are constantly slow, you need to consider your options:
is there another way of getting the same information? For example, could you write a custom coded query in the block/node/panel etc, instead of using a complicated view?
do you really need that module? Some modules are added for the sake of it, to add “flair” to a site, but not all of these are expertly written, or may have problems with scalability
can you implement some sort of full or partial caching mechanism? On shared hosts, high contention over resources will be a likely cause of problems – flat file serving can help here.
If you have mostly anonymous users hitting your front page (assuming this is the real “problem” page), then this isn’t so bad; Drupal has a built-in caching system, which can help. This does involve using the Drupal bootstrap process though, and still involves database access, so if the bottleneck is between your database and web servers, this might not be enough.
If you want to really speed things up for anonymous users, then you can consider a module such as Boost (another is fastpath_fscache); these provide static page caching in the file system, which negates the need for DB access and also Drupal bootstrapping – your web server can serve flat files directly. This is not so useful if you have a lot of logged-in users, as the cache will become quickly dated via this method of working. This could help you through a “slashdotting” though…
Boost comes with quite a lot of documentation (somewhat rare on some Drupal modules), but does require knowledge of the workings of htaccess. Boost also has a well looked after issue queue (last update: less than one day, at time of checking).
Another module worth considering is Block Cache, which as the name suggests caches blocks(!) – useful if you are using a lot of these on one page, perhaps in a complex Panels setup, for example. This is a worthy addition, as it works for authenticated users, so you can have a two-tiered caching system; all pages cached for anonymous users (presumably cache refreshed at intervals by cron) and blocks only cached for authenticated users. This functionality is now a part of Drupal 6 core.
If you’re suffering from database query nightmares, perhaps you could take a look at the QueryCache module. This caches queries to the database, so again this would be useful on sites where there are lots of authenticated users.
If you’re looking to get really technical about the whole matter (ahem!) then you can look to the MemCache module, which forces cache tables to be stored in memory. This has a few dependencies though, and requires “proper” system administration privileges and experience.
This is just a brief overview of some solutions to bottlenecks in your Drupal installations. There are of course a large number of variables in any setup, so you really need to have a clear plan of attack up front! Here are some more resources which cover these areas in greater detail:
http://2bits.com/articles/tips-on-speeding-up-your-drupal-sites.html
http://codesorcery.net/2007/07/23/boost-your-drupal-site/
分享到:
相关推荐
包含:Drupal7宝典; Drupal开发指南; Using Drupal(强烈推荐) 值得你下载!
Drupal dataDrupal data
"Enterprise Drupal 8 Development: For Advanced Projects and Large Development Teams" English | ISBN: 1484202546 | 2017 | 309 pages | PDF | 9 MB Successfully architect a Drupal 8 website that scales ...
drupal6的安装,drupal6的安装drupal6的安装drupal6的安装
drupal7 vs drupal6 详细的列出了从drupal6升级到drupal7所做的一些改动。 从代码,配置,UI,API等全方面的诠释drupal7与drupal6 的不同之处。
Decoupled Drupal in Practice: Architect and Implement Decoupled Drupal Architectures Across the Stack By 作者: Preston So ISBN-10 书号: 1484240715 ISBN-13 书号: 9781484240717 Edition 版本: 1st ed. ...
PHP 编程 Drupal Patch
零起点学习Drupal教程零起点学习Drupal教程零起点学习Drupal教程
drupal7图文安装教程
Drupal6开发手册Drupal6开发手册Drupal6开发手册Drupal6开发手册Drupal6开发手册Drupal6开发手册Drupal6开发手册
Beginning Drupal 8 teaches you how to build, maintain, and manage Drupal 8-based web sites. The book covers what Drupal is, using Drupal when building a new web site, installing and configuring Drupal...
Drupal专业开发指南,这是drupal5版的。可能现在还有人用。
Drupal宝典 用drupal建站必备
Drupal 7 高级开发第三版 Drupal7专业开发指南
Write a Drupal 8 module with custom functionality and hook into various extension points Master numerous Drupal 8 sub-systems and APIs Model, store, and manipulate data in various ways and for various...
Drupal 的核心模块是Drupal 最重要的组成部分,它们是Drupal 主要功能的承载。Drupal 自带有33个模块,基本上涵盖了当前网站所应具有的全部功能:用户管理、博客、论坛、评论、相册以及日志管理的,还有新闻聚合等...
Drupal_1 Drupal_1 Drupal_1 Drupal_1 Drupal_1 Drupal_1
DRUPAL精华教程集.pdf Drupal 打造中国化主题系列教程
Ideal for experienced Drupal developers, this book takes you through RWD basics and shows you how to build sites based on Aurora, Zen, and Omega—three popular base themes created by Drupal ...