Escolar Documentos
Profissional Documentos
Cultura Documentos
Topics: Drupal Planet Performance Caching Images As great as Drupal 7 core can be, it doesn't scale
well for Web sites with a lot of content and/or a lot of users. To make it perform better under these
scenarios, it's necessary to make use of several strategies, tools and techniques.
Although some of items mentioned here can simply be enabled on all Drupal sites to increase performance, I
would instead recommend that folks target problematic areas that will be different for each and every
situation. Take a holistic perspective, and whittle down problem areas to reach a specific performance
target. Basically, it's essential to take measurements before and after making changes. Otherwise, you
could be increasing complexity unnecessarily and targeting the wrong areas, thereby missing opportunities
for larger gains.
I've split this article into several categories listed below. Click on any of these to jump directly to the
respective section.
Views Caching
As the Views module is the most popular contributed module, most of us are using it to display content is
various ways. Views instances should be cached so that when accessed, a cached copy is returned instead of
having to rebuild each view every time it's loaded. There are two (2) options here.
If you've got a lot of content and are using Views paging, you may want to consider using Views Litepager. It
will work around slow COUNT queries on InnoDB tables, those using the default table-engine type in MySQL.
System Administration
Alternative PHP Cache (APC) for PHP < 5.5. (This is part of core PHP in newer versions.)
PHP-FPM (a FastCGI implementation) instead of mod_php.
Nginx: An alternative to the ubiquitous Apache Web server.
Syslog: OS-integrated logging: Send logs to your operating system instead of writing to your database.
Solid state drives (SSDs): These cost more, but if you can afford it, use them instead of classic hard
disk drives (HDDs) in your server hardware.
Disable automatic cron & run a proper cron job: Ensure that users aren't running periodic tasks before
they see content. It's usually not necessary to run it more than once per day, but if more granular
control (over which tasks are run when) is necessary, one can set up theElysia Cron module.
Cache Replacements
The default Drupal-site caching is not very efficient. As a result, alternative mechanisms have sprung up to
fill the void.
External Caching
It's possible to place another application in front of yours that will serve cached copies of your Web pages.
This is called "HTTP acceleration" or "reverse proxy caching". There's really only one game in town, but it
has some helpful add-ons.
Varnish
Varnish HTTP Accelerator Integration
Cache Expiration
If you don't have access to Varnish (usually because of shared hosting), then you can run Boostinstead.
Drupal-Specific Hosting
There are some fine folks out there that will manage the infrastructure for you. If you don't need to be
managing your own software stack, it's probably best to let others do it. The options below generally include
infrastructural features mentioned in this post.
Tools
There are several tools available for tracking your performance.
Useful References
Some great tips can be found at the following links.