Scaling WooCommerce

Draft Warning

You’ve reached a draft 🤷‍♂️ and unfortunately, it’s a work in progress.

Content Error or Suggest an Edit

Notice a grammatical error or technical inaccuracy? Let us know; we will give you credit!

Are you an Expert?

Are you an expert in WooCommerce or scaling WordPress and WooCommerce? Would you like to contribute to this article? Let us know; we will give you credit!
Not

Introduction

This article will provide details on how to scale WooCommerce for a consistent amount of traffic or high-traffic events. These are my opinions and of course I will be bias in this article and will state so when appropriate.

1. Hosting Infrastructure (VPS, Baremetal, Autoscaling)

VPS

Needs content

Baremetal

Needs content

Autoscaling

Needs content

2. Hosting Stack

Webserver

Nginx

Litespeed / Openlitespeed

Caching Plugins

Object Cache

Database

3. Edge Caching / CDN

4. Security

5. Potential WordPress Issues

Plugins using admin-ajax.php

Typically admin-ajax.php would be used for logged in admins, however some plugins will be use admin-ajax.php for non-logged in and logged in users which can become a performance impact. I wrote a whole article on admin-ajax.php and how it can become a performance issue, including a drop-in replacement to improve the admin-ajax.php as well as logging admin-ajax.php requests.

WordPress Plugins utilizing admin-ajax.php causing Performance Issues – Managing WP – All about Managing WordPress
The following article provides information on the WordPress admin-ajax.php function and a list of WordPress Plugins using admin-ajax.php in a manner that
managingwp.io

WordPress Cron

The WordPress cron will run automatically and is triggered each time a WordPress page is loaded no matter the type of user, whether it be a non-logged-in user, a logged-in user or an admin.

WP-Cron works by checking, on every page load, a list of scheduled tasks to see what needs to be run. Any tasks due to run will be called during that page load.

https://developer.wordpress.org/plugins/cron/

If enough tasks line up, it’s quite possible the cron could run for 30 seconds or up to 5 minutes. This can be problematic for the visitor that triggered the cron tasks, as they will not be shown the page they requested until the cron tasks are complete. Additionally, there isn’t much in the way of logging built within WordPress to allow for the investigation of long cron runs or errors that occur.

The solution? Implement a Linux cron, which I also wrote an article about and created a bash script called cron-shim that will run the WordPress cron using the wp-cli command and log the output, time spent and CPU usage, and support for heartbeat checks. Here’s the article

Replacing WordPress WP Cron with Linux cronjob (URL and wp-cli Method) – Managing WP – All about Managing WordPress
The WordPress WP-Cron is used to run scheduled tasks within WordPress core, as well as plugins such as WooCommerce.
managingwp.io

Changelog

  • 06-01-2023 – Initial creation of article 🙂
0 Shares:

You May Also Like