Squeezing the last drop from Drupal

Performance and Scalability

Murray Woodman

cruncht.com

A bit about me

Performance vs Scalability

Easy Wins and Hard Slog

A combination of techniques can get the most out of Drupal.


© rogersmith

It looks hard

It is not always easy to scale Drupal -- not because Drupal sucks, but simply because scaling the LAMP stack (including Drupal) takes no small amount of skill. You need to buy the right hardware, install load balancers, setup MySQL servers in master-slave mode, setup static file servers, setup web servers, get PHP working with an opcode cache, tie in a distributed memory object caching system like memcached, integrate with a content delivery network, watch security advisories for every component in your system and configure and tune the hell out of everything.

Dries Buytaert

But there are some easy wins

Even novice developers and admins can achieve good performance.

Server Tools

Diagnostic tools to measure and monitor performance.


© origomi

Performance Measuring

Essential for development and troubleshooting.

Performance Monitoring

Required for ongoing maintenance and problem identification.

Drupal and Server Profile

Every site is different. How does your site compare?


© alexbarlow

Different kinds of sites

First option sites are more likely run into problems.

Hosting Environment

Hosting environment determines base performance and flexibility.


© candiedwomanire

Hosting Options

Price, performance and simplicity. Pick two.

Performance Out of the Box

Unoptimized Drupal is slow but Drupal has some tricks up its sleeves.


© kp_sonny

Performance built in

YSlow scores pretty good due to:

LAMP Server Tuning

Drupal runs in the context of the LAMP stack. Many different levels which can be tuned.


© crashmaster

Opcode cache

Compiles PHP and puts it into shared memory. Big win for all sites.

Database

Tune database according to your needs.

Web Server

Apache + mod_php + MPM Prefork is the default: heavy and slow.

RAM is precious

Judiciously allocate memory. Avoid swapping at all costs.

Implementation Decisions

Work with Drupal, not against it.


© rowanbank

Issues to consider

In the back of your mind...

Drupal Troubleshooting

Oh no! It's broken. What is wrong? How to fix it.


© aasmundbo

Usual supects

Crack out your performance measuring tools (YSlow, Devel, mysql) to identify issues.

Caching

Drupal can perform at "internet scale" and handle the biggest of sites.


©

Advanced page caching options

Avoid the bootstrap and PHP and maximise performance for anonymous users.

Varnish vs Boost

Comparison between the two.

CacheRouter

CacheRouter provides pluggable backends to cache tables and speed things for logged in users. Load taken off MySQL.

Custom Drupal Distributions

Easy routes to tuned setups. Drupal ecosystem is maturing.


© ryanr

Complexity hidden

End to end solutions covering most tips in this guide.

Benchmarking

Stress test measure to compare results.


© darrenhester

Benchmarking Tools

Hammer your server with the following tools.

Page Rendering

The final leg to the browser makes a big difference... up to 90%.


© fatboyke

Drupal performs well by default

YSlow shows good performance in:

Rendering improvements

Areas where you can make even more of a difference:

Quick Reference

What site do you have? Recap of suggestions.


© koalazymonkey

All sites

Easy wins for all sites.

Low Resources

When RAM is an issue, cut the fat.

Server farm

Dedicated and virtual hosting gives you more options.

Big Site

Millions of nodes uncovers DB weak spots.

High activity

Small memory footprints and high contention of database.

Many logged in users

Page cache not operational - finer grained caching.

High contention

New nodes and new cached elements.

Heavy Content

Big (uncached) multimedia files.

Rich Functionality

Lots of code.

Audience dispersed

Global audience, local store.

Squeezing the last drop from Drupal

Performance and Scalability

Murray Woodman

cruncht.com

A detailed version of this slideshow is available at:

http://cruncht.com/75/drupal-performance-scalability.

Questions?