Tuning up Drupal performance

Submitted by vadim on Fri, 11/05/2010 - 23:56
drupal_performance.png

Yesterday I was invited to the meeting in office of Gorod.ua, the Ukrainian web portal, to speak about Drupal performance. The way like those guys are using Drupal is good, however there are lack of performance. They are spreading a spirit of their child to the whole of Ukraine, so it is a time to expect more visitors. We spoke a lot and I got better understanding of what is needed. We touched many problems, including non typical ones and theoretically solved them.

In this post I'm going to introduce the effective ways of improving performance in Drupal. I've made a review of most popular caching modules and going to show you Drupal performance best practices table, which will help you to chose best caching module depending on your hosting type and Drupal version.

Preconfigured

Pressflow

Pressflow is Drupal distribution that is already configured and patched to improve performance. Features:

  • patched/optimized PHP and MySQL code
  • caching proxy server (Varnish) support
  • db replication support
  • allows to rewrite critical parts in code using Java language
  • easy to port site from Drupal to Pressflow
  • there may be compatibility issues with other nodules
  • read more

Pantheon

Pantheon is virtual LAMP stack with Pressflow and Varnish configured. Pantheon is distributed as Project Mercury AMI (Amazon Machine Image) that can be run only in Amazon Elastic Compute Cloud. This is very cheap start and have rally great benefits for some cases. To learn more, click here.

Tunning up performance for anonymous users

Anonymous user in most cases sends only GET query to the server. Any page which is returned by GET query is easy to cache. Caching avoids making lot's of queries to database and running php code, which are often unnecessary. Hence, caching significantly improves response time. There are several modules, which provide caching of static pages for anonymous users on your Drupal site. You could experiment with setting cache lifetime and memory/storage limit.

Varnish HTTP Accelerator Integration

This module provides integration between your Drupal site and the Varnish HTTP Accelerator, an advanced and very fast reverse-proxy system. Basically, Varnish handles serving static files and anonymous page-views for your site much faster and at higher volumes than Apache, in the neighborhood of 3000 requests per second. You need to install varnish on your server and to patch your D6 installation or to use Pressflow.

Boost

Boost is a module which provides full-page file caching. It is very easy to install and has been throughly tested on Shared, VPS and Dedicated hosting. Boost will cache & gzip compress html, xml, ajax, css, & javascript. Boosts cache expiration logic is very advanced; it's fairly simple to have different cache lifetimes for different parts of your site. For shared hosting this is your best option in terms of improving performance.

When using Boost or Varnish you may also need to configure Ajax Blocks module, which is described below.

Tuning up performance to authenticated users

This is the bottleneck of Drupal. You can feel that experience when many registered users are online. Generally they generate POST queries, which result could not be cached, however there is other approach to handle the performance and several modules which are be described above do this.

Memcache API and Integration

Memcache is free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. When used for Drupal it caches results of SQL queries, which significantly improves Drupal Memcache performance. Memcache is widely used in Drupal community to speed up sites. Memcache API and Integration requires:

APC - Alternative PHP Cache

The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code. Besides being a opcode cache it provides a user cache for storing application data. This module uses the APC user cache as a cache backend for Drupal. It works only in D7.

Flexible cache tuning

Cache Router

CacheRouter is a caching system for Drupal allowing you to assign individual cache tables to specific cache technology. CacheRouter has an option to utilize the page_fast_cache part of Drupal in order to reduce the amount of resources needed for serving pages to anonymous users. It supports: APC, Database, Cache Router, eAccelerator, File, Memcache, Memcached (Alpha), XCache. It have been released for D6 and D5.

Authcache - Authenticated User Page Caching

The Authcache module offers page caching for both anonymous users and logged-in authenticated users. This allows Drupal/PHP to only spend 1-2 milliseconds serving pages, greatly reducing server resources. A separate cache is created for each user role as defined by the administrator, so some roles can be excluded if necessary. Authcache can store cache using different caching handlers: Drupal database, Cache Router, Memcache API, etc. It significantly increase performance when used together with Pressflow or Memcache, read more.

Work around dynamic content problem

Sometimes when using full page caching (Boost or Varnish) or caching with a big lifetime you may want to show dynamic content (which is often changed) in blocks. Following modules handles this problem.

Ajax Blocks

Permits to load some blocks by additional AJAX request after loading the whole cached page when the page is viewed by anonymous user. It is suitable for sites which are mostly static, and the page caching for anonymous users is a great benefit, but there are some pieces of information that have to be dynamic.

Block Cache Alter

Alter cache settings per block. Cache settings per block are now set in code, but if you don't like the default - usually none - you can now easily change this. Install this to speed up block rendering for authenticated users. Module works for D7 only.

Cache Expiration

Playground for ripping the boost expiration code out so other modules can use it. There is now experimental integration with the Varnish module. Support for Node pages, User pages, Comments, Taxonomy, Path Aliases, Front Page Promotion, The Menu Tree, Votingapi, CCK Node Reference, Path Redirects, Domain Access.

Other modules

Apache Solr Search Integration

This module integrates Drupal with the Apache Solr search platform. Solr search can be used as a replacement for core content search and boasts both extra features and better performance. Among the extra features is the ability to have faceted search on facets ranging from content author to taxonomy to arbitrary CCK fields. There are also many module which extends functionality of Apache Solr Search Integration.

Drupal performance best practices table

 

VPS or dedicated server Shared hosting
Drupal 7 APC,
Boost,
Memcache,
Block Cache Alter.
Boost,
Block Cache Alter.
Drupal 6 Varnish,
Memcache,
Cache Expiration,
Authcache,
Ajax Blocks.
Boost,
Cache Router (file),
Authcache,
Ajax Blocks.

Performance Testing

To understand if you are succeed with making your website faster, test it's performance before and after tuning. For this kind of job you can use http://jmeter.apache.org/ or special Drupal module called Blazemeter, which allows to record testing script using Selenium and run it on up to 60 dedicated service using website http://blazemeter.com/.

101 comments

free audio software

Submitted by Anonymous (not verified) on Sat, 04/05/2014 - 20:56.

Frank sold the song to Hollywood, where it was used twice in the same otherwise forgettable Esther Williams swimming-pool musical.free audio software

They may be spreading any

Submitted by johnb6174 (not verified) on Thu, 04/03/2014 - 09:34.

They may be spreading any nature of their child to the full associated with Ukraine, it's the same a period can be expected far more visitors.
is bubblegum casting legitimate

I held two sessions there.

Submitted by is bubblegum casting legitimate (not verified) on Tue, 04/01/2014 - 12:36.

I held two sessions there. First one was about making Drupal distribution and second one was named "Open Source and You Thanks.

great post

Submitted by Anonymous (not verified) on Sun, 03/23/2014 - 14:52.

Hi there! I know this is somewhat off topic but I was wondering which blog platform are you using for this website? I'm getting fed up of Wordpress because I've had issues with hackers and I'm looking at alternatives for another platform. I would be fantastic
if you could point me in the direction of a good platform jual obat asam urat Arga Makmur

Very informative post. I was

Submitted by jams123 (not verified) on Mon, 03/31/2014 - 12:16.

Very informative post. I was looking for information about this topic and this post really helped me a lot. online slots

They are spreading a spirit

Submitted by http://www.howlastlongerinbed.net/ (not verified) on Sun, 03/30/2014 - 00:48.

They are spreading a spirit of their child to the whole of Ukraine, so it is a time to expect more visitors.
http://www.howlastlongerinbed.net/

We touched many problems,

Submitted by jams123 (not verified) on Sat, 03/29/2014 - 12:06.

We touched many problems, including non typical ones and theoretically solved them. seo barcelona

They are spreading a guts of

Submitted by Anonymous (not verified) on Thu, 04/10/2014 - 21:05.

They are spreading a guts of their juvenile to the perfect of Ukraine, so it is a tempo to think better guests. gclub casino

Get a warranty for a new

Submitted by jams123 (not verified) on Fri, 03/28/2014 - 13:04.

Get a warranty for a new computer. This just makes sure you aren’t out of hundreds of dollars if your computer starts messing up. Click here

We spoke a lot and I got

Submitted by descargar counter strike 1.6 (not verified) on Wed, 03/26/2014 - 18:15.

We spoke a lot and I got better understanding of what is needed. We touched many problems, including non typical ones and theoretically solved them.
descargar counter strike 1.6

It is really a rare point for

Submitted by terry jones (not verified) on Thu, 03/27/2014 - 12:50.

It is really a rare point for small children to sit down quiet with regard to large durations of your time, building Air travel Travel trips a difficult task for the majority of the families. www.cheaphotelprices.org

Making journey plans these

Submitted by terry jones (not verified) on Thu, 03/27/2014 - 12:50.

Making journey plans these days is absolutely nothing as easy as packaging your totes and legging it for your chosen location. As the matter associated with fact, when it’s about vacations and holidays, things could possibly get really tough in several respects. www.cheapairlinetravel.org

Pay-per-click is the official

Submitted by terry jones (not verified) on Thu, 03/27/2014 - 12:50.

Pay-per-click is the official term for the sponsored links on the side of search engines queries and side banner ads that persuade (or trick!) clients to visit the site they represent. www.cheapdurpalhosting.com

I certainly get irked whilst

Submitted by jams123 (not verified) on Wed, 03/26/2014 - 15:05.

I certainly get irked whilst people consider worries that they just don't know about.Gatwick Parking

Hence, caching significantly

Submitted by ecommerce web design (not verified) on Mon, 03/24/2014 - 12:36.

Hence, caching significantly improves response time. There are several modules, which provide caching of static pages for anonymous users on your Drupal site.
ecommerce web design

hot hosting companies

Submitted by Anonymous (not verified) on Sat, 03/22/2014 - 22:44.

It was been declared by the head at Washington and this work would be accomplished by the help of a learning center in USA that is Jason Learning. hot hosting companies

We spoke a lot and I got

Submitted by kulutusluotot (not verified) on Sun, 03/23/2014 - 12:15.

We spoke a lot and I got better understanding of what is needed. We touched many problems, including non typical ones and theoretically solved them.
kulutusluotot

Landscaping Services Victoria

Submitted by Landscaping Services Victoria (not verified) on Sat, 03/22/2014 - 08:56.

Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too.

Peoples that were employed in

Submitted by jams123 (not verified) on Sat, 03/22/2014 - 15:33.

Peoples that were employed in stone furnaces moreover structure surroundingss, persons that were unbiased commonly abandoned away of the computer of polio eradication exertions. Seo Barcelona

They are spreading a spirit

Submitted by jams (not verified) on Tue, 03/18/2014 - 10:46.

They are spreading a spirit of their child to the whole of Ukraine, so it is a time to expect more visitors
seo service

Hong Kong has created lending

Submitted by jams123 (not verified) on Wed, 03/19/2014 - 13:59.

Hong Kong has created lending options which are Shariah compliant and it has a number of tracker money as well as changeable sukuks within it’s marketplaces.Seo Barcelona

You have a very nice

Submitted by jams123 (not verified) on Tue, 03/18/2014 - 12:44.

You have a very nice furniture writing style that i appreciate. bean bags are a great way to show your point and the furniture and chairs are very comfortable in the home Facebook Password hack

buy provestra

Submitted by buy provestra (not verified) on Fri, 03/07/2014 - 18:11.

I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share. buy provestra

Once the website design takes

Submitted by Ahmad (not verified) on Wed, 03/19/2014 - 10:59.

Once the website design takes shape, it's time to put it to work. We'll take that pretty picture and make it function using HTML, PHP, CSS, and any other acronym we might need in order to hook things up. lexington ky web design

They are spreading a spirit

Submitted by free bets (not verified) on Thu, 03/13/2014 - 14:07.

They are spreading a spirit of their child to the whole of Ukraine, so it is a time to expect more visitors. We spoke a lot and I got better understanding of what is needed.
free bets

You demand to induct shellac

Submitted by Anonymous (not verified) on Mon, 04/07/2014 - 16:52.

You demand to induct shellac on your server plus to repair your D6 installation or to employment Pressflow.model mayhem

I was looking like that,now I

Submitted by jams123 (not verified) on Mon, 03/10/2014 - 14:37.

I was looking like that,now I found all the details which I want,So thanks for giving decent publish.bubblegum casting

AJAX request after loading

Submitted by alex12 (not verified) on Thu, 03/13/2014 - 15:55.

AJAX request after loading the whole cached page when the page is viewed by anonymous user..free itunes gift cards codes

I don't cerebrate some of

Submitted by Prediksi Bola (not verified) on Sat, 03/15/2014 - 19:30.

I don't cerebrate some of websites offer this typewrite of assemblage.
Prediksi Bola

I certainly get irked whilst

Submitted by seo services (not verified) on Wed, 03/19/2014 - 10:49.

I certainly get irked whilst people consider worries that they just don't know about.seo services

Lakeville

Submitted by Lakeville (not verified) on Thu, 03/06/2014 - 23:56.

You Could write a little more on this subject? I'd be very grateful if You Could elaborate a little bit more. Lakeville

what does bubblegum casting do ?

Submitted by what does bubblegum casting do ? (not verified) on Wed, 03/05/2014 - 23:28.

It contains truly facts. Your website is very valuable. Thanks for sharing. what does bubblegum casting do ?

They are spreading a spirit

Submitted by golf guide (not verified) on Thu, 03/06/2014 - 13:18.

They are spreading a spirit of their child to the whole of Ukraine, so it is a time to expect more visitors. We spoke a lot and I got better understanding of what is needed.
golf guide

I will try to write something

Submitted by Lakeville (not verified) on Fri, 03/07/2014 - 13:06.

I will try to write something to go along with my blog, but we will see. Great post with useful tips and ideas. The Santorini

vietnam tour

Submitted by vietnam tour (not verified) on Wed, 03/05/2014 - 11:11.

I took the time to read on past the first paragraph. You've got so much to say, so much to offer vietnam tour

Eben Pagan Accelerate

Submitted by Eben Pagan Accelerate (not verified) on Tue, 03/11/2014 - 11:10.

We are currently working on a college paper and we have been exploring your blog for a few hours. Eben Pagan Accelerate

Eben Pagan Accelerate Program

Submitted by Eben Pagan Accelerate Program (not verified) on Tue, 03/11/2014 - 14:32.

I will ensure that I bookmark your blog and will come back in the foreseeable future. Eben Pagan Accelerate Program

anonymous vpn

Submitted by anonymous vpn (not verified) on Thu, 03/06/2014 - 10:53.

Actually its a need of human and Developing is must for us successful in life. anonymous vpn

Hello

Submitted by benz (not verified) on Fri, 03/21/2014 - 14:19.

Thanks very much for this great article;this is the stuff that keeps me going through out these day
psn code generator

You entirely duplication our

Submitted by pearly penile papule (not verified) on Tue, 03/11/2014 - 20:21.

You entirely duplication our miserly moreover the discrepancy of our info.
pearly penile papule

hack clash of clans

Submitted by hack clash of clans (not verified) on Mon, 03/03/2014 - 20:59.

I love reading through your blog, I wanted to leave a little comment to support you and wish you a good continuation. hack clash of clans

best credit repair

Submitted by best credit repair (not verified) on Wed, 03/05/2014 - 13:16.

Your post is an excellent example of why I keep coming back to read your excellent quality content that is forever updated. Thank you! best credit repair

pedicure chairs

Submitted by pedicure chairs (not verified) on Mon, 03/03/2014 - 18:55.

Thanks a lot and i'm looking forward to contact you. Will you kindly drop me a e-mail.pedicure chairs

This topic has always been

Submitted by Anonymous1 (not verified) on Wed, 02/26/2014 - 05:56.

This topic has always been one of my favorite subjects to read about. I have found your post to be very rousing and full of good information. I will check your other articles shortly. This was an excellent article. It has some valuable content on this topic. Thank you for compiling it into an easy to read and well written post.The Newsroom seasons 2 DVD Box Set | Cold Case Seasons 1-7 DVD Box Set | NCIS Seasons 1-10 DVD Box Set | Grey's Anatomy Seasons 1-9 DVD Box Set | True Blood Seasons 1-6 DVD Box Set

I required to lie my end of

Submitted by Anonymous1 (not verified) on Wed, 02/26/2014 - 05:55.

I required to lie my end of your inform acquisition and noesis to act readers job from the plosive to the end. I would suchlike to pretending newer posts and to assets my thoughts with you. Great post I must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more. Criminal Minds Seasons 1-8 dvd box set | Game of Thrones Seasons 1-3 DVD Box Set | The Closer Season 1-7 dvd box set | The L Word Seasons 1-6 DVD Box Set | House MD Seasons 1-8 dvd box set

solidworks 2010

Submitted by solidworks 2010 (not verified) on Tue, 02/25/2014 - 11:24.

Your website is very chatty. It will be useful for all of us. You have done a work.solidworks 2010

get the girl code book reviews

Submitted by get the girl code book reviews (not verified) on Sun, 02/23/2014 - 11:06.

Nice Post. It’s really a very good. I noticed all your improtant points. Thanks get the girl code book reviews

try these guys out

Submitted by try these guys out (not verified) on Sat, 02/22/2014 - 10:24.

That's not really a really huge statement, but its all I could come up with after reading this.try these guys out

You need to install varnish

Submitted by Anonymous (not verified) on Sat, 03/01/2014 - 14:45.

You need to install varnish on your server and to patch your D6 installation or to use Pressflow.bubblegum casting legitimate

bank norwegian ränta

Submitted by bank norwegian ränta (not verified) on Wed, 02/19/2014 - 18:47.

She tells you that she just lost the money that her husband had given her to put in the bank and needs to try to win it back. bank norwegian ränta