35
Scaling for High Traffic Sites scalewp.io

Word Press at Scale - WordCamp Minneapolis

Embed Size (px)

Citation preview

Page 1: Word Press at Scale - WordCamp Minneapolis

Scaling for High Traffic Sites

scalewp.io

Page 2: Word Press at Scale - WordCamp Minneapolis

About

Drew GortonWeb Developer, Various (1998-2001)CEO, Gorton Studios (2001-2015)Product Owner, NodeSquirrel (2012-2015)Director of Agency and Community Outreach, Pantheon (Current)

[email protected]@dgorton

Page 3: Word Press at Scale - WordCamp Minneapolis

Why Scale Matters

Page 4: Word Press at Scale - WordCamp Minneapolis

Today’s Topics

● Page Caching

● Object Caching

● Query Performance

● Algorithm Performance

● Searching for Scale

● Elastic Architecture

● Development and Workflow

● A Real-World Scalable Architecture

Page 5: Word Press at Scale - WordCamp Minneapolis

Page Caching

Page 6: Word Press at Scale - WordCamp Minneapolis

Page Caching

Page 7: Word Press at Scale - WordCamp Minneapolis

Page CachingChallenges & Takeaways

● Cache TTL and Expiration● Fragment caching● Cookies

Page 8: Word Press at Scale - WordCamp Minneapolis

Today’s Topics

● Page Caching

● Object Caching

● Query Performance

● Algorithm Performance

● Searching for Scale

● Elastic Architecture

● Development and Workflow

● A Real-World Scalable Architecture

Page 9: Word Press at Scale - WordCamp Minneapolis

Object Caching

An object cache speeds up PHP execution time while lessening the load on the database.

Page 10: Word Press at Scale - WordCamp Minneapolis

Object CacheChallenges & Takeaways

● Complexity● Invalidation● Optimization● Eviction

Page 11: Word Press at Scale - WordCamp Minneapolis

Today’s Topics

● Page Caching

● Object Caching

● Query Performance

● Algorithm Performance

● Searching for Scale

● Elastic Architecture

● Development and Workflow

● A Real-World Scalable Architecture

Page 12: Word Press at Scale - WordCamp Minneapolis

Query Performance

Page 13: Word Press at Scale - WordCamp Minneapolis
Page 14: Word Press at Scale - WordCamp Minneapolis

Query PerformanceChallenges & Takeaways

● Query routing● Replication lag● Debuggability● Regressions

Page 15: Word Press at Scale - WordCamp Minneapolis

Today’s Topics

● Page Caching

● Object Caching

● Query Performance

● Algorithm Performance

● Searching for Scale

● Elastic Architecture

● Development and Workflow

● A Real-World Scalable Architecture

Page 16: Word Press at Scale - WordCamp Minneapolis

Algorithm Performance

Page 17: Word Press at Scale - WordCamp Minneapolis

Algorithm PerformanceChallenges & Takeaways

● Mo’ data, Mo’ problems.● Test with big data sets to find

problems before they hit production.

● Avoid bloating the DOM / blowing up the UX.

● Load data as you need it.

Page 18: Word Press at Scale - WordCamp Minneapolis

Today’s Topics

● Page Caching

● Object Caching

● Query Performance

● Algorithm Performance

● Searching for Scale

● Elastic Architecture

● Development and Workflow

● A Real-World Scalable Architecture

Page 19: Word Press at Scale - WordCamp Minneapolis

Searching for Scale

Use a dedicated search index like Apache Solr or ElasticSearch

Page 20: Word Press at Scale - WordCamp Minneapolis

Searching for Scale

Challenge & Takeaways

● Overriding WP_Query()● Index Rebuilds● Complexity

Page 21: Word Press at Scale - WordCamp Minneapolis

Today’s Topics

● Page Caching

● Object Caching

● Query Performance

● Algorithm Performance

● Searching for Scale

● Elastic Architecture

● Development and Workflow

● A Real-World Scalable Architecture

Page 22: Word Press at Scale - WordCamp Minneapolis

Elastic ArchitectureHorizontal Scalability Is the Scalability That Matters

Page 23: Word Press at Scale - WordCamp Minneapolis

Traditional OptionsShared vs VM vs Cluster

Page 24: Word Press at Scale - WordCamp Minneapolis

Traditional Options at ScaleIn Real Life

Page 25: Word Press at Scale - WordCamp Minneapolis

Next Generation ArchitectureThe Same Design, Just Add More

Page 26: Word Press at Scale - WordCamp Minneapolis

Elastic Architecture

Challenges and Takeaways

● Load balancing● Shared media● Consistency

Page 27: Word Press at Scale - WordCamp Minneapolis

Today’s Topics

● Page Caching

● Object Caching

● Query Performance

● Algorithm Performance

● Searching for Scale

● Elastic Architecture

● Development and Workflow

● A Real-World Scalable Architecture

Page 28: Word Press at Scale - WordCamp Minneapolis

Development & Workflow

Page 29: Word Press at Scale - WordCamp Minneapolis

Development & Workflow

Page 30: Word Press at Scale - WordCamp Minneapolis

Development Workflow

Challenges & Takeaways

● Environmental consistency● Site configuration● Local development● Automation

Page 31: Word Press at Scale - WordCamp Minneapolis

Today’s Topics

● Page Caching

● Object Caching

● Query Performance

● Algorithm Performance

● Searching for Scale

● Elastic Architecture

● Development and Workflow

● A Real-World Scalable Architecture

Page 32: Word Press at Scale - WordCamp Minneapolis

A modern stack:

● Reverse proxy (e.g. Varnish)● Apache or Nginx● PHP● Memcached or Redis● MySQL and Database

Replication● ElasticSearch or Solr● Linux● Version control (Git)● CI server

Page 33: Word Press at Scale - WordCamp Minneapolis

If you don’t want to do it all on your own...

Page 34: Word Press at Scale - WordCamp Minneapolis

Learn more on scalewp.io

Page 35: Word Press at Scale - WordCamp Minneapolis

Questions?

Drew Gorton@dgorton