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

A717e9d055b2284e573b2412e32f5397?s=128

WordPress Greek Community

November 19, 2016
Tweet

Transcript

  1. Scaling WooCommerce Challenges, Solutions, Bottlenecks Antonis Zachopoulos Web Developer @

    Nevma
  2. Scaling WooCommerce - WordCamp Athens 2016 The Case Book publishing

    & trading company Vast amount of data Sync from remote ERP software
  3. Scaling WooCommerce - WordCamp Athens 2016 The Case

  4. 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
  5. Scaling WooCommerce - WordCamp Athens 2016 The General Principles

  6. Scaling WooCommerce - WordCamp Athens 2016 Mark Your Progress Why

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

    are your friend! Minimize loss in case of a failure Resume capability
  8. 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
  9. Scaling WooCommerce - WordCamp Athens 2016 The Hidden Obstacles

  10. Scaling WooCommerce - WordCamp Athens 2016 Querying by meta_value

  11. Scaling WooCommerce - WordCamp Athens 2016 Querying by meta_value

  12. 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...)
  13. Scaling WooCommerce - WordCamp Athens 2016 Querying by meta_value

  14. Scaling WooCommerce - WordCamp Athens 2016 Querying by meta_value

  15. 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!)
  16. Scaling WooCommerce - WordCamp Athens 2016 The Object Cache The

    what?
  17. None
  18. None
  19. 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!
  20. Scaling WooCommerce - WordCamp Athens 2016 The Object Cache

  21. Scaling WooCommerce - WordCamp Athens 2016 The Object Cache Object

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

    term assignment to posts Products === Posts Categories / Attribute values === Terms Recalculated on every assignment
  23. Scaling WooCommerce - WordCamp Athens 2016 Taking it all to

    the front-end
  24. Scaling WooCommerce - WordCamp Athens 2016 The “Shop” page Useful

    for user navigation? Consider listing top-level categories instead
  25. 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!
  26. Scaling WooCommerce - WordCamp Athens 2016 Product categories widget Can't

    do without it Beware of the listing depth though!
  27. Scaling WooCommerce - WordCamp Athens 2016 The right DB engine

    InnoDB VS MyISAM Faster joins
  28. 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
  29. 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?
  30. 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!
  31. Scaling WooCommerce - WordCamp Athens 2016 Fin! Thanks for watching!

    Questions?