jeff rigby on scaling drupal in the enterprise

Post on 15-Jan-2015

1.609 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Presentation by Jeff Rigby held Thursday, October 29th, 2009 at DPCI Seminar on Drupal in the Enterprise

TRANSCRIPT

© 2009 DPCI. All Rights Reserved.

Drupal for the Enterprise

Seminar by DPCI featuring Dries Buytaert

Michael Mainiero, and Jeff Rigby

Thursday, October 29, 2009

© 2009 DPCI. All Rights Reserved.

Drupal for the Enterprise

Presented by Jeff RigbyWeb Application Architect, DPCI

Thursday, October 29th, 2009

© 2009 DPCI. All Rights Reserved.

Goals of this PresentationDescribe how to scale Drupal from an out-of-box build to an enterprise level solutionExplain some of the approaches DPCI has used with our clients to meet their scaling needs

© 2009 DPCI. All Rights Reserved.

Scaling DrupalAnonymous is easy to scale— Mirror servers— Reverse-Proxy caches— Drupal only manages the content

Authenticated traffic is more difficult— Each dynamic page must be processed by PHP— Requires more horsepower

© 2009 DPCI. All Rights Reserved.

Built In OptionsConfiguration— Drupal page/block cache— Page compression— Aggregate JS/CSS

Coding— Drupal cache (use it!)— Use static variables when possible

Immediately usable with no additional modules

Built In Options Results

© 2009 DPCI. All Rights Reserved.

5.8

4.8

96.5

4.8

0 20 40 60 80 100 120

Anon

Auth

Requests Per Second

Optimized

OOB

© 2009 DPCI. All Rights Reserved.

Quick OptimizationsBoostMemcachedOpcode Cache

© 2009 DPCI. All Rights Reserved.

BoostAmazing performance gainAnonymous users onlyServes static filesNo additional software or hardware needed

© 2009 DPCI. All Rights Reserved.

MemcachedEasy to install on the serverMinor module configurationRemoves the cache from the databaseOptionally removes session tracking from the databaseSignificantly reduces MySQL statements

© 2009 DPCI. All Rights Reserved.

Opcode Cache— A few out there (APC, Zend Optimizer, XCache,

eAccelerator)— Easy to install— Pre-compiles PHP in memory— Reduces server load

Combined Results

© 2009 DPCI. All Rights Reserved.

5.8

4.8

427

15.1

0 100 200 300 400 500

Anon

Auth

Request Per Second

Optimized

OOB

© 2009 DPCI. All Rights Reserved.

MySQL TweaksTune your MySQL configuration to your server. MySQL Tuner is very useful: http://blog.mysqltuner.comEnable the query cache! Enable the slow query log to spot problem queries

© 2009 DPCI. All Rights Reserved.

Apache SOLRModule provides drop-in replacement for searchGets search out of DrupalAvoids expensive node_load() callsAvailable as a hosted solution from Acquia

© 2009 DPCI. All Rights Reserved.

Reverse-Proxy CacheSquid or VarnishRun on the same server or clustered on multiple external serversCan reduce web server traffic by 90%+ if serving the entire site (anonymous traffic)For dynamic sites, offload all static files (JS, CSS, images, etc.) and let Apache focus on PHPLow overheadTip: Override the expires header (— Expires: Sun, 19 Nov 1978 05:00:00 GMT

Reverse-Proxy Cache

© 2009 DPCI. All Rights Reserved.

© 2009 DPCI. All Rights Reserved.

Use a CDNMany options out there: Akamai, Amazon, CacheFlyGenerally easy to setupOff-load entire site or only static files (JS, CSS, images, etc.)Can be expensive

© 2009 DPCI. All Rights Reserved.

Static Page TipsJavascript!Store dynamic values in a cookieUse AJAX to load small portions of dynamic contentUse Javascript to replace dates with natural language “About 4 Minutes Ago”

© 2009 DPCI. All Rights Reserved.

Load Balanced Web ServersUse rsync to keep Web servers synched or NFS web rootAdvanced load balancers can handle server failuresEasy to add or remove servers with no site downtimeRun server intensive tasks (cron, data import, etc.) on an internal server to avoid site slow downs

© 2009 DPCI. All Rights Reserved.

Multiple MySQL DatabasesMaster / Slave Setup— Minimum of 2 servers— Drupal 5 and 6 require minor core hacks— Built into Drupal 7!— Be mindful of database lag— Reliant on master database

Use Memcached to share the query cache across all serversClustering and distributed configurations

Sample Large Scale Site

© 2009 DPCI. All Rights Reserved.

© 2009 DPCI. All Rights Reserved.

Questions?Jeff’ s Blog:

www.databasepublish.com/blog/jrigby

Scaling Drupal

top related