Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Antonis Zachopoulos - Scaling WooCommerce - WordCamp Athens 2016

Antonis Zachopoulos - Scaling WooCommerce - WordCamp Athens 2016

WordPress Greek Community

November 19, 2016
Tweet

More Decks by WordPress Greek Community

Other Decks in Programming

Transcript

  1. Scaling WooCommerce - WordCamp Athens 2016 The Case Book publishing

    & trading company Vast amount of data Sync from remote ERP software
  2. Scaling WooCommerce - WordCamp Athens 2016 The Challenges Data model

    differences The sheer numbers 100.000+ products (posts) 2.500+ product categories (taxonomy terms) 35.000+ authors (product attribute values, a.k.a. taxonomy terms) Synchronization must complete overnight E-shops must remain responsive to user-actions Stick to native WordPress/WooCommerce
  3. Scaling WooCommerce - WordCamp Athens 2016 Mark Your Progress Why

    iterate all items daily? Use timestamps! Assume full catalog updates are rare.
  4. Scaling WooCommerce - WordCamp Athens 2016 Divide & Conquer Batches

    are your friend! Minimize loss in case of a failure Resume capability
  5. Scaling WooCommerce - WordCamp Athens 2016 KISS Principle Need a

    web server for syncing? No data to present Why worry about server limits? Run PHP via CLI instead Spawn WordPress yourself
  6. Scaling WooCommerce - WordCamp Athens 2016 Querying by meta_value “-Um,

    maybe you’re overreacting?” 100.000 products * 0.26 sec = ~7 hours (and no actual work done yet...)
  7. Scaling WooCommerce - WordCamp Athens 2016 Querying by meta_value “-Cool!

    And will that cut it?” 100.000 products * 0.0004 sec = ~40 sec (and still got plenty of time left!)
  8. Scaling WooCommerce - WordCamp Athens 2016 The Object Cache Bulk

    imports: not the typical case Maintaining the cache: cost for no gain! Time Memory Can be suspended!
  9. Scaling WooCommerce - WordCamp Athens 2016 The Object Cache Object

    Cache active: ~3 sec Object Cache suspended: ~0.05 sec Time reduced more than 90%!
  10. Scaling WooCommerce - WordCamp Athens 2016 Term counting WordPress counts

    term assignment to posts Products === Posts Categories / Attribute values === Terms Recalculated on every assignment
  11. Scaling WooCommerce - WordCamp Athens 2016 The “Shop” page Useful

    for user navigation? Consider listing top-level categories instead
  12. Scaling WooCommerce - WordCamp Athens 2016 Product filters Displaying 1.000s

    of values – A Utopia Use with caution on high-level lists A cross-platform issue Need to think smarter!
  13. Scaling WooCommerce - WordCamp Athens 2016 Product categories widget Can't

    do without it Beware of the listing depth though!
  14. Scaling WooCommerce - WordCamp Athens 2016 Some aces up sleeve

    Use output compression (Content-Encoding: gzip) Cache like the wind! Varnish Caching plugin MySQL query caching
  15. Scaling WooCommerce - WordCamp Athens 2016 Wrapping it up 100.000+

    products (posts) 2.500+ product categories (taxonomy terms) 35.000+ authors (product attribute values, a.k.a. taxonomy terms) Is it feasible?
  16. Scaling WooCommerce - WordCamp Athens 2016 Wrapping it up Plan

    in advance Code with efficiency in mind Love your infrastructure Think out of the box And have the courage to deal with the unforeseen!