High Performance Drupal

C
Chapter ThreeChapter Three
High Performance Drupal
     Making Your Site Fast Fast Fast
Drupal Is Powerful
Drupal is Slow
Databases are Slow
PHP Is Slow
Consumer-Grade Networks Are
           Slow
Increasing Speed Means Diving
  Less Deeply Into The Stack
Fast Is Making Fewer Requests
     From Faster Sources
The Life Of A Pageload

•   Browser Request

•   Browser Cache?

•   Network Request

•   Server Response

•   Associated Assets (back to top)
Optimizing For The Browser

•   Make Your HTML/CSS Images Efficient

•   Use CSS/JS Aggregation

•   Use a CDN

•   Yslow is good for profiling this
Optimizing Server Response


•   Reverse Proxy/Drupal Page Cache

•   PHP OpCode Cache

•   Drupal System Cache
Reverse-Proxies Are Very Fast
Faster Than Apache
Much Faster Than Drupal
Don’t Bother Your Power Tools
      With Simple Tasks
Implementing Varnish

•   Use Pressflow

•   Implement A Simple VCL Based On Sessions

•   Enable Aggressive Caching

•   Enjoy, Experiment, Excel
OpCode Caching Keeps Drupal
    Loaded In Memory
Don’t Touch The Disk
Don’t Load Up Apache Threads
   With Copies of Drupal
Implementing APC

•   The Biggest/Cheapest Win

•   Install via apt-get, yum, or pecl

•   Monitor with apc.php

•   Lots of modules? Bump the SHM size

•   Enable apc.stat=0 with caution
Drupal Freezes It’s Code Before
            Launch
Most Real-World Scaling
Information Comes After Release
Drupal Supports A Crazy Array Of
           Use Cases
$5/month Shared Hosting Is Not
      High Performance
Pressflow
•   “Pressflow Makes Drupal Scale”

•   Drop-in Replacement For Core

•   Backports many Drupal 7 features

•   PHP 5.x/MySQL 5.x Required

•   Enables robust reverse-proxy, mysql replication and more

•   Runs drupal.org and many other high-performance sites
Drupal Has A Cache And That Is
            Good
But... Drupal’s Cache Is In The
           Database
And Serialized.
That Works Anywhere, But Is Both
      Slow and Expensive
CacheRouter

•   Use settings.php to plug in cacherouter instead of /includes/cache.inc

•   Pick your poison: APC, XCache, Memcached, Filesystem, or classic db
    caching.

•   Change caches per table.

•   Vital for high-speed logged-in pageloads.
Coming Soon: Advcache

•   Cache Nodes, Users, Taxonomy Terms and other common objects via
    cacherouter.

•   Extends the notion of drupal’s static cache to whole objects.

•   Still in development, but if you’re into writing patches...
Other Tips

•   Search is among the slowest and most expensive queries. Use Solr
    instead.

•   InnoDB can help with locking in MySQL

•   Hardware is faster and often more cost effective than code cleanup.

•   Monitor load and scale ahead of problems.
Benchmarking/Profiling


•   Cachegrind to profile code.

•   Jmeter to simulate load.

•   Slow Query logs, cactai, etc.
Vertical/Horizntal Scaling

•   Start with all services you need.

•   Separate services into layers.

•   Add more servers at each layer as needed.

•   Shameless plug: Project Mercury: http://getpantheon.com
High Performance Drupal
More Resources

•   http://groups.drupal.org/high-performance

•   http://pressflow.org

•   http://tag1consulting.com

•   http://2bits.com

•   http://getpantheon.com
1 of 36

More Related Content

What's hot(17)

Web performance TalkWeb performance Talk
Web performance Talk
Prasoon Agrawal569 views
Drupal performanceDrupal performance
Drupal performance
Piyuesh Kumar234 views
Drupal cachingDrupal caching
Drupal caching
Exove2.2K views
RESTful Web services in Drupal 8RESTful Web services in Drupal 8
RESTful Web services in Drupal 8
valuebound4.3K views
World Wide Web CachingWorld Wide Web Caching
World Wide Web Caching
ersanbilik2.1K views
Understanding Web CacheUnderstanding Web Cache
Understanding Web Cache
ProdigyView2.9K views
WordCamp RVAWordCamp RVA
WordCamp RVA
codearachnid_test164 views
23 Ways To Speed Up WordPress23 Ways To Speed Up WordPress
23 Ways To Speed Up WordPress
Zero Point Development138 views
Optimize drupalOptimize drupal
Optimize drupal
Le Thanh Sang881 views
Website performance optimization QAWebsite performance optimization QA
Website performance optimization QA
Denis Dudaev653 views
Caching StrategiesCaching Strategies
Caching Strategies
Michal Špaček11.7K views

Similar to High Performance Drupal(20)

Pure Speed Drupal 4 Gov talkPure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talk
Bryan Ollendyke644 views
Midwest PHP - Scaling MagentoMidwest PHP - Scaling Magento
Midwest PHP - Scaling Magento
Mathew Beane1.2K views
Performance outPerformance out
Performance out
Andrea Martinez96 views
Caching strategies with luceeCaching strategies with lucee
Caching strategies with lucee
Gert Franz1.5K views
2 72 7
2 7
Oleg Petrov178 views
Performance_Out.pptxPerformance_Out.pptx
Performance_Out.pptx
sanjanabal246 views
Performance outPerformance out
Performance out
Jack Huang247 views
Performance outPerformance out
Performance out
Jack Huang272 views
Performance outPerformance out
Performance out
Dragan Kolarevic403 views
titletitle
title
michalsap71 views
Performance outPerformance out
Performance out
Sergey Bran206 views
Performance outPerformance out
Performance out
test account156 views
Performance outPerformance out
Performance out
Jack Huang215 views
Performance outPerformance out
Performance out
Moderator_kursa43 views
Performance outPerformance out
Performance out
Jack Huang604 views
Performance outPerformance out
Performance out
Jack Huang189 views
Speeding Up The SnailSpeeding Up The Snail
Speeding Up The Snail
Marcus Deglos1.4K views

More from Chapter Three(6)

Drupal as a winning Web PlatformDrupal as a winning Web Platform
Drupal as a winning Web Platform
Chapter Three533 views
Pantheon @ Drupal Down UnderPantheon @ Drupal Down Under
Pantheon @ Drupal Down Under
Chapter Three1.5K views
Enterprise DrupalEnterprise Drupal
Enterprise Drupal
Chapter Three1K views
A Match Made In The CloudA Match Made In The Cloud
A Match Made In The Cloud
Chapter Three1.9K views
Panels 3.0: The Powers Of Chaos MagicPanels 3.0: The Powers Of Chaos Magic
Panels 3.0: The Powers Of Chaos Magic
Chapter Three1.8K views
Drupal In The CloudDrupal In The Cloud
Drupal In The Cloud
Chapter Three10K views

Recently uploaded(20)

Java Platform Approach 1.0 - Picnic MeetupJava Platform Approach 1.0 - Picnic Meetup
Java Platform Approach 1.0 - Picnic Meetup
Rick Ossendrijver20 views
CXL at OCPCXL at OCP
CXL at OCP
CXL Forum158 views
ChatGPT and AI for Web DevelopersChatGPT and AI for Web Developers
ChatGPT and AI for Web Developers
Maximiliano Firtman143 views

High Performance Drupal