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/.

149 comments

We touched many problems,

Submitted by Anonymous (not verified) on Mon, 07/28/2014 - 13:44.

We touched many problems, including non typical ones and theoretically solved them.
serrurier paris

Drupal is the biggest

Submitted by emily Carlton (not verified) on Wed, 07/23/2014 - 13:16.

Drupal is the biggest platform I think. People rely on Drupal a lot. http://woodlawnchurch.net/presbyterian-churches-st-pete/

clash of clans hack

Submitted by prem (not verified) on Wed, 07/23/2014 - 14:50.

hello friends if you want free clash of clans game codes download and gems through this site....clash of clans hack

Drupal is a great platform

Submitted by Anonymous (not verified) on Wed, 07/23/2014 - 09:39.

Drupal is a great platform for blogging, website creation for small business to midsized business. http://halfwayhomes.org/addict-recovery

Get free steam wallet codes at zero penny and enjoy.

Submitted by aarav (not verified) on Mon, 07/21/2014 - 12:06.

This post is fabulious,and enjoy more exicting hacking codes,free sream wallet codes at zero cost than go through us. http://free-steamwalletcodes.com/

The obscure little rabbit. He

Submitted by Maydi (not verified) on Thu, 07/24/2014 - 07:51.

The obscure little rabbit. He is food for many of the predators of the wild. He reproduces at an alarming rate. He can be found in most areas of the country. www.sportrabbit.org

Singapore has become a sort

Submitted by Maydi (not verified) on Thu, 07/24/2014 - 07:50.

Singapore has become a sort of a sporting phenomenon of late, and we can only place the root of this new, sprouting interest to our recent successes of late. We have two world-class table tennis players who displayed a magnificent performance at the recent Beijing Olympics. www.esportshub.org

Ngiring Nangkring

Submitted by obat kanker kelenjar getah bening (not verified) on Tue, 07/08/2014 - 06:29.

the natural world continues to undergo relational transformation and this is the obat sinusitis alami world of our experience. we invent words like obat anemia 'technocracy', 'capitalism', 'sovereigntism', 'authoritarianism', 'christianity', 'islam' to obat maag point to 'belief systems' obat darah tinggi alami which involve 'rules' and 'regulating' of one's behaviour through the intellect obat stroke alami. sovereigntism requires that we pay taxes to ace maxs a central authority to fund the hiring of police and military to ensure that we continue to obat jantung koroner alami pay taxes

Everything has to see the

Submitted by Janeyu (not verified) on Thu, 07/03/2014 - 09:24.

Everything has to see the changes to know about now. We will be seeing each way to happen. - Dr. Hicham Riba

On the lookout for a approach

Submitted by aaaggjk (not verified) on Tue, 07/15/2014 - 10:11.

On the lookout for a approach to revitalize and pump up your hair? With just three or fewer bundles of Brazilian hair, you possibly can drastically change the way in which your locks look with out harsh chemicals or remedies. A. Sure. The Brazilian Blowout truly works best on chemically treated hair, and helps to improve the find it here for you hairs situation by fortifying every strand with important amino acids. The hair is collected from ladies in the South American region and the donor get paid for the hair donation. Generally hair suppliers use Mongolian hair because it has related smooth character. The hair is bought at hair auctions. Cadiveu Brazilian Thermal Reconstruction Demand change! Ask the FDA to recall hair straightening products that include formaldehyde. NAAT Brazilian Keratin Serum Extremely Shine

Looking to make a career

Submitted by Maydi (not verified) on Thu, 07/24/2014 - 07:51.

Looking to make a career change into a fun and exciting industry? Do you find yourself obsessive about your favorite sport? If so, then breaking into the sports industry just might be what you are looking for. www.sportindustryjobs.org

mr.aris

Submitted by vimax (not verified) on Sat, 06/14/2014 - 19:28.

saat ini masyarakat kita semakin banyak orang yang memilih untuk sendiri atau kebanyakan kasus terpaksa untuk menyendiri karena Keadaan ini mendorong mereka untuk mencari cara-cara alternatif menangani dorongan seksual pada dirinya, Untuk itu kami hadir menawarkan alat bantu sex wanita yang bisa menjadi alternatif pilihan dalam memuaskan dorongan seksual tersebut.

My twitter

Submitted by My twitter (not verified) on Thu, 06/12/2014 - 19:30.

I am searching awesome news and idea. What I have found from your site, it is actually highly content.My twitter

There are several modules,

Submitted by jams (not verified) on Sun, 06/01/2014 - 15:08.

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.
canada classifieds

verу awesome blog post. Wе

Submitted by jon (not verified) on Sat, 05/31/2014 - 22:42.

verу awesome blog post. Wе аrе reаllу grateful fоr уour blog post. Yоu wіll find а lot оf approaches aftеr visiting уоur post. I wаs exасtly searching for. Thankѕ fоr ѕuch post аnd рlеaѕе keеp іt up. Great work
baju batik baju batik

Football (or soccer as the

Submitted by Maydi (not verified) on Thu, 07/24/2014 - 07:51.

Football (or soccer as the 'non-Brits' refer to it as) is the most popular sport in the World. Millions of people play, at various levels, every single day. Most people play for fun, others professionally, however the aim of the game is almost always the same - WIN! www.betterfootball.org

Nice article. thanks for

Submitted by Anonymous (not verified) on Wed, 05/28/2014 - 13:00.

Nice article. thanks for sharing. forum komunitas

We spoke a lot and I got

Submitted by jams (not verified) on Wed, 05/28/2014 - 10:16.

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.
newfoundland classifieds

Guaranteed profits! You

Submitted by Maydi (not verified) on Thu, 07/24/2014 - 07:50.

Guaranteed profits! You wouldn't think it's possible to get guaranteed profits from fixed odds bookmakers. Well it is. With sports arbitrage betting you can get risk free profits time and time again. You are invited to read our article on sports arbitrage. www.sportzup.org

There are several modules,

Submitted by jams (not verified) on Sun, 05/25/2014 - 09:44.

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.
Mercedes mechanic anaheim

joey atlas' naked beauty symulast method review

Submitted by joey atlas' naked beauty symulast method review (not verified) on Fri, 05/23/2014 - 00:15.

This article has some great and useful information about this subject. Thank you for sharing it in an easy to read and understandable format. joey atlas' naked beauty symulast method review

They are spreading a spirit

Submitted by jams (not verified) on Mon, 05/19/2014 - 13:50.

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.
film streaming

SEO conference

Submitted by SEO conference (not verified) on Wed, 05/14/2014 - 15:09.

I really have learned a lot from you.Thanks for sharing.So many people have come to your blog. SEO conference

free minecraft gift card

Submitted by aman (not verified) on Sun, 06/15/2014 - 11:26.

if you need the free minecraft gift card than visit our site and get in free of cost.get minecraft in free

Great post ! I am actually

Submitted by jams (not verified) on Mon, 05/12/2014 - 14:23.

Great post ! I am actually getting ready to across this information, is very helpful my friend. Also great blog here with all of the valuable information you have. Keep up the good work you are doing here
Brad Reifler

here's a link to visit my site

Submitted by here's a link to visit my site (not verified) on Thu, 05/08/2014 - 20:29.

Carry on this. work at home In the end, I would like to thank you for making such a nice website here's a link to visit my site

No contract cellular plans

Submitted by No contract cellular plans (not verified) on Tue, 05/06/2014 - 00:31.

You have done really nice job. There are many people searching about that now they will find enough sources by your tips. No contract cellular plans

Test inside ensure your

Submitted by jacksmith (not verified) on Sat, 05/03/2014 - 08:33.

Test inside ensure your TK0-201 braindumps 100% passing Guarantee. We provide you all latest and updated exam questions and answers which are easy to learn in PDF and Testing Engine Format.220-601 braindumps

Conference

Submitted by Conference (not verified) on Wed, 04/30/2014 - 12:55.

yes,of course body language matters alot it eventually raise your confidence if it is positive.it really help us in tackling diffrent things. Conference

It was largely through his

Submitted by sepatu new balance murah (not verified) on Thu, 05/01/2014 - 07:29.

It was largely through his efforts that the Boston Harbor Lighthouse on Little Brewster Island is forever manned, even though the lighthouse itself is automated. sepatu futsal nike tiempo genio | sepatu adidas 11 questra original | jual sepatu futsal specs online

reee

Submitted by Anonymous (not verified) on Tue, 06/03/2014 - 01:02.

largely through his efforts that the Boston Harbor Lighthouse on Little Brewster Island is forever manned largely through his efforts that the Boston Harbor Lighthouse on Little Brewster Island is forever manned tvs barcode printer | Industrial barcode printer dealers | barcode labels suppliers | biometric attendance system pune | USB fingerprint readers |

his efforts that the Boston

Submitted by Anonymous (not verified) on Tue, 06/03/2014 - 01:07.

his efforts that the Boston Harbor Lighthouse on Little Brewster Island is forever manned largely through his efforts that the Boston Harbor Lighthouse on Little Brewster Island is forev mice control | insects control | pc repairing centre | laptop repairing | motherboard chip level repairing |

reee

Submitted by Anonymous (not verified) on Tue, 06/03/2014 - 01:03.

his efforts that the Boston Harbor Lighthouse on Little Brewster Island is forever manned largely through his efforts that the Boston Harbor Lighthouse on Little Brewster Island is f his efforts that the Boston Harbor Lighthouse on Little Brewster Island is forever manned largely through his efforts that the Boston Harbor Lighthouse on Little Brewster Island is f Access control readers | cctv camera dealers | outdoor dome cctv camera price | ptz cctv camera price | fire fighting system suppliers |

n Harbor Lighthouse on Little

Submitted by Anonymous (not verified) on Tue, 06/03/2014 - 01:04.

n Harbor Lighthouse on Little Brewster Island is forever manned largely through his efforts that the Boston Harbor Lighthouse on Little Brewster Island is f his efforts that the Boston Harbor Lighthouse on Little Brewster Island is forever manned largely through his efforts th Gaseous Fire suppression models | Fire alarm system types | tea vending machine price | tea vending machine price | coffee vending machine price |

ster Island is forever manned

Submitted by Anonymous (not verified) on Tue, 06/03/2014 - 01:05.

ster Island is forever manned largely through his efforts that the Boston Harbor Lighthouse on Little Brewster Island is f his efforts that the Boston Harbor Lighthouse on Little Brewst projector | Panasonic projector models | Hitachi projector price | | inverter dealers Mumbai |
inverter price in Mumbai |

nd is forever manned largely

Submitted by Anonymous (not verified) on Tue, 06/03/2014 - 01:06.

nd is forever manned largely through his efforts that the Boston Harbor Lighthouse on Little Brewster Islandnd is forever manned largely through his efforts that the Boston Harbor Lighthouse on Little Brewster Island inverter battery | solar cooker | seo service india | seo service india | biological pest control |

You can always be sure you're

Submitted by anymous (not verified) on Thu, 04/24/2014 - 23:55.

You can always be sure you're reading unbiased, factual, and accurate information. http://www.frivzi.com/category/girls-games/

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.

The Article is quite

Submitted by natural yeast infection cures (not verified) on Thu, 05/01/2014 - 07:32.

The Article is quite impressive and thoughts been put up has clearly got something to state. Nice Post! how to get bigger breast | how can i grow taller | potty training girls |

This source is a reliable

Submitted by Jazzie Lue (not verified) on Wed, 07/23/2014 - 09:20.

This source is a reliable one. I have team working behind this issue. Drupal is updating fast. after surgery bra

It seems to me effective and

Submitted by Monica Herrera (not verified) on Thu, 07/31/2014 - 09:32.

It seems to me effective and trustworthy. I am thinking seriously about this. home health care insurance

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

I love this book. I have read

Submitted by James Rodrigez (not verified) on Wed, 07/16/2014 - 18:31.

I love this book. I have read this on my own and also shared this one .Thanks to you for sharing this here. woodlawnchurch

Do you know more about this?

Submitted by Robbie Barnehill (not verified) on Fri, 07/18/2014 - 19:42.

Do you know more about this? This is now an updated issue. I like to learn more about this. Credit Union Web Hosting