SlideShare a Scribd company logo
Joshua Eichorn, CTO CONFERENCE 
SCALING 
WOOCOMMERCE 
Joshua Eichorn 
CTO Pagely 
1
Joshua Eichorn, CTO CONFERENCE 
WHO AM I? 
‣ CTO of Pagely dealing with WordPress 
at Scale every day 
‣ Long time Open Source Developer, 
PHPDocumentor, PEAR 
‣ Lots of experience with PHP at extreme 
scale at Stumbleupon 
2
Joshua Eichorn, CTO CONFERENCE 
WHAT DO WE MEAN BY SCALE? 
‣ High volume of traffic 
‣ High volume of transactions 
‣ Large product catalog 
3
Joshua Eichorn, CTO CONFERENCE 
TODAY’S FOCUS 
‣ High volume of traffic 
‣ Large transaction volume is largely a sizing issue 
‣ Large product catalog is largely unsolved. Normally this means importing 
data, importer performance will be your main issue. 
4
Joshua Eichorn, CTO CONFERENCE 
HAVE REALISTIC EXPECTATIONS 
‣ Successful stores generate data (orders, products, reviews) 
‣ Don’t expect to host a store for the same cost as a blog 
‣ You will need more Mysql capacity: storage, memory, and CPU 
‣ You will need more PHP capacity: CPU and memory 
‣ You will likely want shell access so you can use WP-CLI for maintenance 
5
Joshua Eichorn, CTO CONFERENCE 
SCALING WORDPRESS = PAGE CACHING 
‣ WordPress scaling has generally focused on page caching using Nginx or 
Varnish 
‣ Most blogs are serving mostly static content 
‣ Ecommerce isn’t that different, the majority of your product pages etc are 
static content 
6
Joshua Eichorn, CTO CONFERENCE 
PAGELY VPS CACHED 
7
Joshua Eichorn, CTO CONFERENCE 
PAGELY VPS NO CACHING 
8
Joshua Eichorn, CTO CONFERENCE 
PERSONALIZATION BREAKS CACHING 
‣ Logged in users 
‣ Showing the Cart status on every page 
‣ Using a plugin that starts a PHP session 
‣ Recommendations based on past purchases 
9
Joshua Eichorn, CTO CONFERENCE 
PERSONALIZATION SHOULDN’T BREAK 
CACHING 
‣ Most sites use very minimal personalization 
‣ Option #1: Cache pages unless a specific cookie is set, only set cookie 
when an item is in the cart 
‣ Option #2: Client side personalization 
10
Joshua Eichorn, CTO CONFERENCE 
CACHE PAGES UNLESS A 
SPECIFIC COOKIE IS SET 
‣ WooCommerce sets the cookie for 
you 
‣ woocommerce_items_in_cart=1 
‣ This is an easy solution, no template 
changes needed 
map $http_cookie $no_cache_cookie { 
default 0; 
"~woocommerce_" 1; 
"~wordpress_" 1; 
} 
server { 
listen 80; 
proxy_cache CONTENT; 
proxy_cache_min_uses 1; 
proxy_cache_valid 200 30m; 
location / { 
proxy_no_cache $no_cache_cookie; 
proxy_cache_bypass $no_cache_cookie; 
proxy_set_header Host $host; 
proxy_pass http://realserver:80; 
} 
} 
11 
NGINX Example
Joshua Eichorn, CTO CONFERENCE 
CLIENT SIDE PERSONALIZATION 
‣ Store the data you need in a cookie 
‣ Read the cookie on the client side, update UI 
‣ This isn’t happening out of the box so it takes some work 
12
Joshua Eichorn, CTO CONFERENCE 
WILL CACHING SOLVE EVERYTHING? 
‣ Maybe 
‣ What does your traffic look like 
‣ The more successful you are at driving purchases the less helpful caching 
is 
‣ Use cache purging or low cache times or both 
‣ Large catalogs lower cache hit rates 
13
Joshua Eichorn, CTO CONFERENCE 
WHAT MAKES YOUR SITE SLOW 
‣ Running PHP code (uses CPU) 
‣ Talking to MySql (waiting) 
‣ Talking to an Object Cache (waiting) 
‣ Talking to external services (waiting) 
‣ Doing fileIO (waiting) 
14
Joshua Eichorn, CTO CONFERENCE 
THEME/PLUGIN CHOICES CAN MAKE 
YOUR SITE UN-SCALABLE 
‣ Showing 500 products on one page 
‣ Dynamic menus that load every page in your site from the DB 
‣ Calling a Facebook API on every page load 
‣ Loading images over http to get there size 
15
Joshua Eichorn, CTO CONFERENCE 
HOW TO SIZE YOUR SERVER 
‣ PHP-FPM is easier to scale them mod_php 
‣ # of workers hard limit is ram 
‣ Useful limit is amount of CPU 
‣ Run enough concurrent traffic to bring CPU to 100% (ab -c 2 http://localhost/) 
‣ Once you reach this point, more workers are trading off speed for concurrency 
‣ If that level of concurrency is less then you see in your logs on a regular basis 
‣ You need a bigger server or you need to be faster 
16
Joshua Eichorn, CTO CONFERENCE 
SCALING OUT VS SCALING UP 
‣ Bigger servers are easier then many servers 
‣ Many servers gets you added reliability as well as more scale 
‣ On most cloud platforms it’s the same cost or cheaper to scale 
up 
‣ Splitting out Mysql makes sense in almost all cases, due to 
different reliability needs 
‣ Test splitting out object cache, usage is very round trip heavy, it 
may be slower 
17
Joshua Eichorn, CTO CONFERENCE 
SCALING OUT 
‣ Scale out webservers: 
‣ Direct traffic – Amazon ELB, Nginx, Varnish, Apache mod_proxy 
‣ Sync files – DRBD, Lsyncd (Don’t use nfs) 
‣ Scale out Mysql: 
‣ Master + Read Slaves (doesn’t scale writes) 
‣ Hyperdb DB drop-in 
‣ Slave lag monitoring is important, HyperDb has examples 
18
Joshua Eichorn, CTO CONFERENCE 
QUESTIONS 
19
Joshua Eichorn, CTO CONFERENCE 
THANK YOU 
20 
Find us at pagely.com

More Related Content

What's hot

Improve Blog Loading Time using WordPress Plugins by Minifying Scripts
Improve Blog Loading Time using WordPress Plugins by Minifying ScriptsImprove Blog Loading Time using WordPress Plugins by Minifying Scripts
Improve Blog Loading Time using WordPress Plugins by Minifying Scripts
BlashO
 
Show Me The Cache!
Show Me The Cache!Show Me The Cache!
Show Me The Cache!
Andy Melichar
 
WordPress website optimization
WordPress website optimizationWordPress website optimization
WordPress website optimization
Daniel Kanchev
 
WordPress.org & Optimizing Security for your WordPress sites
WordPress.org & Optimizing Security for your WordPress sitesWordPress.org & Optimizing Security for your WordPress sites
WordPress.org & Optimizing Security for your WordPress sites
GovLoop
 
DrupalCon Barcelona 2015
DrupalCon Barcelona 2015DrupalCon Barcelona 2015
DrupalCon Barcelona 2015
Daniel Kanchev
 
How to Clear WordPress Cache?
How to Clear WordPress Cache?How to Clear WordPress Cache?
How to Clear WordPress Cache?
HTS Hosting
 
Leeward WordPress Meetup- Caching and Website Speed
Leeward WordPress Meetup- Caching and Website SpeedLeeward WordPress Meetup- Caching and Website Speed
Leeward WordPress Meetup- Caching and Website Speed
Arlen Nagata
 
Extreme Javascript Minification
Extreme Javascript MinificationExtreme Javascript Minification
Extreme Javascript Minification
David Goemans
 
Vps server 11
Vps server 11Vps server 11
Vps server 11
RicoVierra08
 
Squeeze Maximum Performance From Your Joomla Website
Squeeze Maximum Performance From Your Joomla WebsiteSqueeze Maximum Performance From Your Joomla Website
Squeeze Maximum Performance From Your Joomla Website
SiteGround.com
 
Front-End Web Performance Optimization by BucketSoft
Front-End Web Performance Optimization by BucketSoftFront-End Web Performance Optimization by BucketSoft
Front-End Web Performance Optimization by BucketSoft
Steve Wortham
 
Speed up Your Joomla Site for Ultimate Performance
Speed up Your Joomla Site for Ultimate PerformanceSpeed up Your Joomla Site for Ultimate Performance
Speed up Your Joomla Site for Ultimate Performance
JoomlaDay Australia
 
JavaScript development methodology
JavaScript development methodologyJavaScript development methodology
JavaScript development methodology
Aleksander Fabijan
 
Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...
Thomas Audunhus
 
Breaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites WinBreaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites Win
Jonathan Hochman
 
Using WebSockets with ColdFusion
Using WebSockets with ColdFusionUsing WebSockets with ColdFusion
Using WebSockets with ColdFusioncfjedimaster
 
Introduction to WordPress Security
Introduction to WordPress SecurityIntroduction to WordPress Security
Introduction to WordPress Security
Nile Flores
 
Ship WordPress Projects Like a Boss
Ship WordPress Projects Like a BossShip WordPress Projects Like a Boss
Ship WordPress Projects Like a Boss
SiteGround.com
 
2deHands.be - Tuning a Big Classifieds Site
2deHands.be - Tuning a Big Classifieds Site2deHands.be - Tuning a Big Classifieds Site
2deHands.be - Tuning a Big Classifieds Site
nlwebperf
 

What's hot (20)

Improve Blog Loading Time using WordPress Plugins by Minifying Scripts
Improve Blog Loading Time using WordPress Plugins by Minifying ScriptsImprove Blog Loading Time using WordPress Plugins by Minifying Scripts
Improve Blog Loading Time using WordPress Plugins by Minifying Scripts
 
Show Me The Cache!
Show Me The Cache!Show Me The Cache!
Show Me The Cache!
 
WordPress website optimization
WordPress website optimizationWordPress website optimization
WordPress website optimization
 
WordPress.org & Optimizing Security for your WordPress sites
WordPress.org & Optimizing Security for your WordPress sitesWordPress.org & Optimizing Security for your WordPress sites
WordPress.org & Optimizing Security for your WordPress sites
 
DrupalCon Barcelona 2015
DrupalCon Barcelona 2015DrupalCon Barcelona 2015
DrupalCon Barcelona 2015
 
How to Clear WordPress Cache?
How to Clear WordPress Cache?How to Clear WordPress Cache?
How to Clear WordPress Cache?
 
Leeward WordPress Meetup- Caching and Website Speed
Leeward WordPress Meetup- Caching and Website SpeedLeeward WordPress Meetup- Caching and Website Speed
Leeward WordPress Meetup- Caching and Website Speed
 
Extreme Javascript Minification
Extreme Javascript MinificationExtreme Javascript Minification
Extreme Javascript Minification
 
Vps server 11
Vps server 11Vps server 11
Vps server 11
 
Squeeze Maximum Performance From Your Joomla Website
Squeeze Maximum Performance From Your Joomla WebsiteSqueeze Maximum Performance From Your Joomla Website
Squeeze Maximum Performance From Your Joomla Website
 
Front-End Web Performance Optimization by BucketSoft
Front-End Web Performance Optimization by BucketSoftFront-End Web Performance Optimization by BucketSoft
Front-End Web Performance Optimization by BucketSoft
 
Speed up Your Joomla Site for Ultimate Performance
Speed up Your Joomla Site for Ultimate PerformanceSpeed up Your Joomla Site for Ultimate Performance
Speed up Your Joomla Site for Ultimate Performance
 
JavaScript development methodology
JavaScript development methodologyJavaScript development methodology
JavaScript development methodology
 
Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...
 
Breaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites WinBreaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites Win
 
JEE
JEEJEE
JEE
 
Using WebSockets with ColdFusion
Using WebSockets with ColdFusionUsing WebSockets with ColdFusion
Using WebSockets with ColdFusion
 
Introduction to WordPress Security
Introduction to WordPress SecurityIntroduction to WordPress Security
Introduction to WordPress Security
 
Ship WordPress Projects Like a Boss
Ship WordPress Projects Like a BossShip WordPress Projects Like a Boss
Ship WordPress Projects Like a Boss
 
2deHands.be - Tuning a Big Classifieds Site
2deHands.be - Tuning a Big Classifieds Site2deHands.be - Tuning a Big Classifieds Site
2deHands.be - Tuning a Big Classifieds Site
 

Similar to Scaling woo commerce-v2-pagely

The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
Otto Kekäläinen
 
Optimizing Wordpress For Speed And Security
Optimizing Wordpress For Speed And SecurityOptimizing Wordpress For Speed And Security
Optimizing Wordpress For Speed And Security
TopMarketingStrategies.com
 
What is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress HostingWhat is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress Hosting
WPSFO Meetup Group
 
JS digest. July 2018
JS digest.  July 2018JS digest.  July 2018
JS digest. July 2018
ElifTech
 
Lambda Architectures in Practice
Lambda Architectures in PracticeLambda Architectures in Practice
Lambda Architectures in Practice
C4Media
 
Advanced Drupal 8 Caching
Advanced Drupal 8 CachingAdvanced Drupal 8 Caching
Advanced Drupal 8 Caching
David Timothy Strauss
 
I Can Haz More Performanz?
I Can Haz More Performanz?I Can Haz More Performanz?
I Can Haz More Performanz?
Andy Melichar
 
SOA Knowledge Kit, Developer Productivity and Performance Comparison Analysis
SOA Knowledge Kit, Developer Productivity  and Performance Comparison AnalysisSOA Knowledge Kit, Developer Productivity  and Performance Comparison Analysis
SOA Knowledge Kit, Developer Productivity and Performance Comparison Analysis
Clever Moe
 
(For non-developers) HTML5: A richer web for everyone
(For non-developers) HTML5: A richer web for everyone(For non-developers) HTML5: A richer web for everyone
(For non-developers) HTML5: A richer web for everyone
Chris Mills
 
JS digest. Decemebr 2017
JS digest. Decemebr 2017JS digest. Decemebr 2017
JS digest. Decemebr 2017
ElifTech
 
Mastering Migration - How to Manage a Move From Another CMS to WordPress with...
Mastering Migration - How to Manage a Move From Another CMS to WordPress with...Mastering Migration - How to Manage a Move From Another CMS to WordPress with...
Mastering Migration - How to Manage a Move From Another CMS to WordPress with...
WP Engine
 
From 0 to 0xdeadbeef - security mistakes that will haunt your startup
From 0 to 0xdeadbeef - security mistakes that will haunt your startupFrom 0 to 0xdeadbeef - security mistakes that will haunt your startup
From 0 to 0xdeadbeef - security mistakes that will haunt your startup
Diogo Mónica
 
23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboards23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboards
Denis Ristic
 
Tweak Geeks #FOS15
Tweak Geeks #FOS15Tweak Geeks #FOS15
Tweak Geeks #FOS15
Pascal Fantou
 
Varnishtest
VarnishtestVarnishtest
Varnishtest
Varnish Software
 
Web Browsers - Their Main working
Web Browsers - Their Main workingWeb Browsers - Their Main working
Web Browsers - Their Main working
Yougourta AIT SAADA
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
Wim Godden
 
More efficient, usable web
More efficient, usable webMore efficient, usable web
More efficient, usable web
Chris Mills
 
Advanced and technical SEO - Apr 2011 - Beijk martijn
Advanced and technical SEO - Apr 2011 - Beijk martijnAdvanced and technical SEO - Apr 2011 - Beijk martijn
Advanced and technical SEO - Apr 2011 - Beijk martijn
François-Yves Prigent
 

Similar to Scaling woo commerce-v2-pagely (20)

The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
 
Optimizing Wordpress For Speed And Security
Optimizing Wordpress For Speed And SecurityOptimizing Wordpress For Speed And Security
Optimizing Wordpress For Speed And Security
 
What is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress HostingWhat is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress Hosting
 
JS digest. July 2018
JS digest.  July 2018JS digest.  July 2018
JS digest. July 2018
 
Lambda Architectures in Practice
Lambda Architectures in PracticeLambda Architectures in Practice
Lambda Architectures in Practice
 
Advanced Drupal 8 Caching
Advanced Drupal 8 CachingAdvanced Drupal 8 Caching
Advanced Drupal 8 Caching
 
I Can Haz More Performanz?
I Can Haz More Performanz?I Can Haz More Performanz?
I Can Haz More Performanz?
 
SOA Knowledge Kit, Developer Productivity and Performance Comparison Analysis
SOA Knowledge Kit, Developer Productivity  and Performance Comparison AnalysisSOA Knowledge Kit, Developer Productivity  and Performance Comparison Analysis
SOA Knowledge Kit, Developer Productivity and Performance Comparison Analysis
 
(For non-developers) HTML5: A richer web for everyone
(For non-developers) HTML5: A richer web for everyone(For non-developers) HTML5: A richer web for everyone
(For non-developers) HTML5: A richer web for everyone
 
JS digest. Decemebr 2017
JS digest. Decemebr 2017JS digest. Decemebr 2017
JS digest. Decemebr 2017
 
73 Less Fugly Epicenter
73 Less Fugly   Epicenter73 Less Fugly   Epicenter
73 Less Fugly Epicenter
 
Mastering Migration - How to Manage a Move From Another CMS to WordPress with...
Mastering Migration - How to Manage a Move From Another CMS to WordPress with...Mastering Migration - How to Manage a Move From Another CMS to WordPress with...
Mastering Migration - How to Manage a Move From Another CMS to WordPress with...
 
From 0 to 0xdeadbeef - security mistakes that will haunt your startup
From 0 to 0xdeadbeef - security mistakes that will haunt your startupFrom 0 to 0xdeadbeef - security mistakes that will haunt your startup
From 0 to 0xdeadbeef - security mistakes that will haunt your startup
 
23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboards23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboards
 
Tweak Geeks #FOS15
Tweak Geeks #FOS15Tweak Geeks #FOS15
Tweak Geeks #FOS15
 
Varnishtest
VarnishtestVarnishtest
Varnishtest
 
Web Browsers - Their Main working
Web Browsers - Their Main workingWeb Browsers - Their Main working
Web Browsers - Their Main working
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
More efficient, usable web
More efficient, usable webMore efficient, usable web
More efficient, usable web
 
Advanced and technical SEO - Apr 2011 - Beijk martijn
Advanced and technical SEO - Apr 2011 - Beijk martijnAdvanced and technical SEO - Apr 2011 - Beijk martijn
Advanced and technical SEO - Apr 2011 - Beijk martijn
 

Recently uploaded

Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
vrstrong314
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
QuickwayInfoSystems3
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Game Development with Unity3D (Game Development lecture 3)
Game Development  with Unity3D (Game Development lecture 3)Game Development  with Unity3D (Game Development lecture 3)
Game Development with Unity3D (Game Development lecture 3)
abdulrafaychaudhry
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 

Recently uploaded (20)

Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Game Development with Unity3D (Game Development lecture 3)
Game Development  with Unity3D (Game Development lecture 3)Game Development  with Unity3D (Game Development lecture 3)
Game Development with Unity3D (Game Development lecture 3)
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 

Scaling woo commerce-v2-pagely

  • 1. Joshua Eichorn, CTO CONFERENCE SCALING WOOCOMMERCE Joshua Eichorn CTO Pagely 1
  • 2. Joshua Eichorn, CTO CONFERENCE WHO AM I? ‣ CTO of Pagely dealing with WordPress at Scale every day ‣ Long time Open Source Developer, PHPDocumentor, PEAR ‣ Lots of experience with PHP at extreme scale at Stumbleupon 2
  • 3. Joshua Eichorn, CTO CONFERENCE WHAT DO WE MEAN BY SCALE? ‣ High volume of traffic ‣ High volume of transactions ‣ Large product catalog 3
  • 4. Joshua Eichorn, CTO CONFERENCE TODAY’S FOCUS ‣ High volume of traffic ‣ Large transaction volume is largely a sizing issue ‣ Large product catalog is largely unsolved. Normally this means importing data, importer performance will be your main issue. 4
  • 5. Joshua Eichorn, CTO CONFERENCE HAVE REALISTIC EXPECTATIONS ‣ Successful stores generate data (orders, products, reviews) ‣ Don’t expect to host a store for the same cost as a blog ‣ You will need more Mysql capacity: storage, memory, and CPU ‣ You will need more PHP capacity: CPU and memory ‣ You will likely want shell access so you can use WP-CLI for maintenance 5
  • 6. Joshua Eichorn, CTO CONFERENCE SCALING WORDPRESS = PAGE CACHING ‣ WordPress scaling has generally focused on page caching using Nginx or Varnish ‣ Most blogs are serving mostly static content ‣ Ecommerce isn’t that different, the majority of your product pages etc are static content 6
  • 7. Joshua Eichorn, CTO CONFERENCE PAGELY VPS CACHED 7
  • 8. Joshua Eichorn, CTO CONFERENCE PAGELY VPS NO CACHING 8
  • 9. Joshua Eichorn, CTO CONFERENCE PERSONALIZATION BREAKS CACHING ‣ Logged in users ‣ Showing the Cart status on every page ‣ Using a plugin that starts a PHP session ‣ Recommendations based on past purchases 9
  • 10. Joshua Eichorn, CTO CONFERENCE PERSONALIZATION SHOULDN’T BREAK CACHING ‣ Most sites use very minimal personalization ‣ Option #1: Cache pages unless a specific cookie is set, only set cookie when an item is in the cart ‣ Option #2: Client side personalization 10
  • 11. Joshua Eichorn, CTO CONFERENCE CACHE PAGES UNLESS A SPECIFIC COOKIE IS SET ‣ WooCommerce sets the cookie for you ‣ woocommerce_items_in_cart=1 ‣ This is an easy solution, no template changes needed map $http_cookie $no_cache_cookie { default 0; "~woocommerce_" 1; "~wordpress_" 1; } server { listen 80; proxy_cache CONTENT; proxy_cache_min_uses 1; proxy_cache_valid 200 30m; location / { proxy_no_cache $no_cache_cookie; proxy_cache_bypass $no_cache_cookie; proxy_set_header Host $host; proxy_pass http://realserver:80; } } 11 NGINX Example
  • 12. Joshua Eichorn, CTO CONFERENCE CLIENT SIDE PERSONALIZATION ‣ Store the data you need in a cookie ‣ Read the cookie on the client side, update UI ‣ This isn’t happening out of the box so it takes some work 12
  • 13. Joshua Eichorn, CTO CONFERENCE WILL CACHING SOLVE EVERYTHING? ‣ Maybe ‣ What does your traffic look like ‣ The more successful you are at driving purchases the less helpful caching is ‣ Use cache purging or low cache times or both ‣ Large catalogs lower cache hit rates 13
  • 14. Joshua Eichorn, CTO CONFERENCE WHAT MAKES YOUR SITE SLOW ‣ Running PHP code (uses CPU) ‣ Talking to MySql (waiting) ‣ Talking to an Object Cache (waiting) ‣ Talking to external services (waiting) ‣ Doing fileIO (waiting) 14
  • 15. Joshua Eichorn, CTO CONFERENCE THEME/PLUGIN CHOICES CAN MAKE YOUR SITE UN-SCALABLE ‣ Showing 500 products on one page ‣ Dynamic menus that load every page in your site from the DB ‣ Calling a Facebook API on every page load ‣ Loading images over http to get there size 15
  • 16. Joshua Eichorn, CTO CONFERENCE HOW TO SIZE YOUR SERVER ‣ PHP-FPM is easier to scale them mod_php ‣ # of workers hard limit is ram ‣ Useful limit is amount of CPU ‣ Run enough concurrent traffic to bring CPU to 100% (ab -c 2 http://localhost/) ‣ Once you reach this point, more workers are trading off speed for concurrency ‣ If that level of concurrency is less then you see in your logs on a regular basis ‣ You need a bigger server or you need to be faster 16
  • 17. Joshua Eichorn, CTO CONFERENCE SCALING OUT VS SCALING UP ‣ Bigger servers are easier then many servers ‣ Many servers gets you added reliability as well as more scale ‣ On most cloud platforms it’s the same cost or cheaper to scale up ‣ Splitting out Mysql makes sense in almost all cases, due to different reliability needs ‣ Test splitting out object cache, usage is very round trip heavy, it may be slower 17
  • 18. Joshua Eichorn, CTO CONFERENCE SCALING OUT ‣ Scale out webservers: ‣ Direct traffic – Amazon ELB, Nginx, Varnish, Apache mod_proxy ‣ Sync files – DRBD, Lsyncd (Don’t use nfs) ‣ Scale out Mysql: ‣ Master + Read Slaves (doesn’t scale writes) ‣ Hyperdb DB drop-in ‣ Slave lag monitoring is important, HyperDb has examples 18
  • 19. Joshua Eichorn, CTO CONFERENCE QUESTIONS 19
  • 20. Joshua Eichorn, CTO CONFERENCE THANK YOU 20 Find us at pagely.com