Building a Scalable Resiliant WP Setup

Scaling with hardware alone is expensive. We’ve worked with a few high traffic sites and a lot of demanding ecommerce/WooCommerce sites. The way we’ve scaled those is by testing the code, optimising database calls, optimising the database itself and implemented full page caching.

Here’s a few tips to get you started

  1. Use nginx instead of apache for better performance.
  2. Use MariaDB instad of mysql.
  3. Replace any get_posts and WP_Query calls with optimised $wpdb queries.
  4. Use various optimisation tools eg. gtmetrix, pagespeed or yslow to check for problems
  5. Use mysql general logging and check the speed for each and every query. Install indexes where needed.
  6. Once optimisation is complete, implement some form of full page caching for pages that are not dynamic. Consider using ajax for dynamic elements.

If optimisation is not enough then you might want to look into load balancing or a cluster setup.

tech