Skip directly to content

Drupal wants to be fast. or What Aaron learned today

on Mon, 03/07/2011 - 16:41

Today I took a class on Drupal Performance and Scalability and learned the following.

Drupal is slow

Out of the box it is. If you are running a Drupal site out of the box with no configuration changes and no caching set, your users are suffering. Sure you don't have to feel the pain because you aren't going to your own site everyday, but eventually you are going to feel the pain because your users are leaving your site and not returning.

With the help of some other Open Source tools, you can have a beautifully fast web platform. For the sake of numbers a base vanilla install of pressflow may be able to serve ~33 requests per second with 98% of responses given in 1.5seconds. While the same server that has APC, Drupal Cache, and Varnish can serve ~4958 requests per second with 98% of responses given in 7milliseconds.

On the scalability side, memcached is a good tool. While it doesn't really make the site faster, it does help by reducing the number of hits on the database engine, releasing the db engine to server actual results.

One big thing that can slow your system is using pager in views. The main reason is that the views gets run twice, once for the count of records and once to display the records. There are ways to bypass this reducing your query time by close to half.

The big recommendation is monitoring and benchmarking. Know where your slow spots are and attack each one accordingly.

If I had to bullet point it:
* If you are running a Drupal version < 7, use Pressflow instead
* Take benchmarks to measure improvements (ab, jmeter, seige...)
* Use an opcache (APC-Cache)
* Turn on Drupal Caching as well
* install and use Varnish
* use memcached
* Monitor each piece

There is not a silver bullet system that will work for everyone simply because each site is different. Find something slowing your site and decide if it needs to be fixed. If so, fix it and iterate. After some tweaks your Drupal install can be a very fast system.

Post new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or class="OPTIONS" [title="the title"].
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.