scaling woocommerce - wordcamp mumbai 2016

29
@rahul286 #wcmumbai Scaling WooCommerce

Upload: rtcamp

Post on 15-Apr-2017

2.889 views

Category:

Technology


0 download

TRANSCRIPT

@rahul286 #wcmumbai

Scaling WooCommerce

- Blogger

- First rtCamper

- Obsessed with speed

About me

1. Blogger

2. rtCamper

3. Husband

4. Father

5. Sandwich-wala

Sandwich-wala

State of the Word

State of the WordPress Caching

Typical Architecture!

Typical Architecture!

Handle (almost) entire load at

NGINX Level

WooCommerce @ NGINX level

- Output depends on customers

- Same URL, different output

- /cart/

- /checkout/

- /my-account/

- /* (user specific element in header,

sidebar)

At each tier

Scaling WooCommerce

NGINX

- If your theme has user-specific elements in

header/footer/sidebar, ajaxify them

- If you cannot ajaxify, use “Window Shopping

Technique”

NGINX - Cache Product Pages

NOT trademarked!

Window Shopping Technique

¯\_(ツ)_/¯

1. Start with entire site cached

2. Monitor woocommerce cookie for cart items

3. As soon as a visitor adds something to cart,

start bypassing cache for them only.

http://rt.cx/wcwst

Window Shopping Technique

- Faster site for folks who are “Just Looking”

- Can handle more traffic, specially spikes!

But... What about folks who are actually buying?

NGINX Tier Summary

PHP

Easy Part

1. WordPress Object Cache FTW!

a. https://wordpress.org/plugins/redis-cache/

b. Object cache also speed-up Transients API

c. ee site create/update example.com --wpredis

2. PHP7

a. ee site create/update example.com --php7

Tough Part

1. Architecture

a. AJAX

b. AngularJS/React

2. Code Quality

a. Fast and readable (in order)

b. Debug - Like A Hero

MySQL

1. SSD. Always. Period. One more Period.

2. RAM > mysql database size

3. CPU cores (enough of them)

Hardware

Software

1. Slow Query (ee debug --mysql)

2. ElasticSearch - elasticpress-woocommerce

3. WordPress Object Cache Again

4. MySQLTuner

10071

Sorry no demo this time :|

Thank You!

@rahul286 #wcmumbai

Q & A