This article provides performance tips for advanced users and/or IT personnel that are struggling with a WooCommerce site that is starting to experience a slower than normal response while navigating through the shopping cart.

In most cases, slow web page loading is simply due to the fact that ecommerce sites are dynamic in nature, and require more resources for PHP and database queries as traffic increases. That’s where PHP workers come into play. Read more below about what PHP workers are and how they are used to speed up the processing of requests on your site.

What Is a PHP Worker?

Today, most web based applications are developed in a programming language called PHP (this includes WooCommerce). However, PHP is not the same thing as a PHP worker. A PHP worker is a background process on a server that runs PHP code to build pages, query databases, schedule background tasks, and more. Nearly every database request from a PHP developed ecommerce site (such as WooCommerce) is considered to be a background process. PHP workers handle all the queries for finding products, and more importantly, are directly responsible for generating the HTML pages to serve to your site’s visitors. The more PHP workers you have, the less likely processes will get backed up. Consequently, PHP workers are a critical function to PHP and every PHP-based shopping cart system in the world relies on these workers.

For those who are not as tech savvy, maybe an analogy is in order here. Pretend for a moment that PHP is a General in the military who commands all operations and a PHP worker is the soldier used to carry out the job for the General. If the government chooses to do so, it can step in and only provide the General two soldiers to work with at a time and limit how much the General can get done in a certain timeframe. In a similar correlation, your PHP-based ecommerce site will have boundaries that only allow PHP to call upon a specific number of PHP workers at any given time. These constraints come from your hosting provider and the hosting plan you sign up for.

The heavier traffic sites are more likely to need more PHP workers and will be charged accordingly for a server with enough resources to support larger PHP worker limits.

2024 Comparison Chart of Popular WooCommerce Hosting Providers and PHP Worker Limits

HostsPHP WorkersComments
NexcessStarts from 10 PHP workers to 50 PHP workers with an enterprise planMost scalable options compared to other hosts and ranks as a top performing host
SitegroundStarts from 4 workers and goes up to 16 workers with an enterprise plan.A balanced choice for performance and scalability with pricing that is reasonable for smaller operations
PressableScalable to 100 PHP workersProven top performing hosting provider with scalable options for the largest of companies.
CloudWaysUnlimited PHP workersProvider may not be providing enough system resources to effectively handle the unlimited PHP worker claim (PHP unlimited is actually 6000 workers). Also, unlimited PHP workers is not necessarily a good thing because it can have an adverse performance affect with too many background processes running and not enough resources to handle other tasks quickly.
KinstaOffers 4 PHP workers but can scale to more if needed.Although Kinsta has had a reputation for being one of the top hosting providers, they have really fallen off the radar in recent years. Their WooCommerce hosting plans have minimal PHP workers and our clients have reported it to be much slower than other providers. Kinsta can offer more PHP workers, but they reserve it to their high-end custom plans that start at $1200/month or more. Once the premier host, now a bait and switch company in our opinion.
A2HostingStarts at 2 PHP workersNot enough to make this a top hosting provider

In general, the hosts which offer more PHP workers are known for offering better site performance.    However, it is evident that some hosts have become clever in their marketing with respect to PHP workers.  For example,  CloudWays advertises unlimited PHP workers  which would make you think that this provider must be the fastest hosted platform to use.  But CloudWays actually underperforms many other top hosts that only offer 4 workers.  This means that the host is likely bottlenecking the PHP workers with minimal CPU and RAM.  Without proper system resources, the claim of a very large number of PHP workers won’t matter.  So, be careful of exaggerated  PHP workers claim in the same monthly price range as other hosts.

How Many PHP workers do I really need?

If your site visitors are complaining about periodic page load error 502 or error 504 , then you are definitely experiencing a bottleneck with PHP workers or a maxed out CPU.

Unfortunately, there is no exact formula for how many PHP workers you should have for a good performing ecommerce site. There are many factors at play and there is a limit to how effective a site can be if too many PHP workers are in use. In general, an ecommerce site should have no less than 4 PHP workers to start with. For heavier traffic sites, a minimum of around 10 PHP workers to start and possibly a few dozen PHP workers could be needed if your site is prone to a sudden influx of website visitors.

How to Optimize Your Site’s PHP Worker Usage

We’ve explained that PHP workers are background processes that generate things like HTML pages with PHP code. Now, the most obvious way to reduce and optimize PHP worker usage is to reduce the amount of CPU and PHP resources required to fulfill requests to your site.

The first step to reducing PHP worker usage is setting up caching layers for your WordPress site. By default, WordPress is a dynamic Content Management System that fulfills every page request on demand. This means it will repetitively require PHP workers to perform the steps for multiple site visitors over and over again. This can become highly inefficient unless you introduce something referred to as cache. There are two types of caches, Page Caching and Object Caching. For ecommerce sites, an object cache is the most important and beneficial of the two.

Here’s how to do it.

1. Set up Object Caching for Your WordPress Site

For high-traffic and database-heavy sites, adding a persistent object cache like Redis in front of your MySQL database can boost performance and reduce loads on PHP workers.

Redis saves your page rendered database queries in RAM, which allows PHP to grab the results of queries that have already been executed. This method of object caching allows PHP workers to conserve CPU resources and spend less time fulfilling a request because it removes the need for repetitive database queries.

2. Optimize Your PHP Code

PHP Workers are sometimes over-used as a result of poorly written plug-ins and code snippets added to a WordPress site.

Extending WordPress core with these additional features has become so easy that oftentimes we go overboard without thinking about the potential impact on site performance. Therefore, the first way to optimize your PHP code is to perform a site-wide audit to determine what plugins and code snippets are truly necessary.

Choose Lightweight Themes

From our experience, we’ve found that themes are often a major contributor to site performance issues as well and should not be overlooked. Poorly written themes can be bloated and create too many database queries on each and every page load of your site. Again, more queries means more PHP workers are needed to get the job done. When building a WordPress site, it’s important to choose a theme that is customizable, quick to load and makes the least of database queries possible.

3. Choose a Performance-Focused WooCommerce Host

The right WooCommerce host can have a huge impact on the performance of your site. Since a PHP worker’s efficiency is directly correlated with CPU and RAM, hosting your site on a modern server with the latest hardware can help you optimize PHP worker usage. This is not always easy to do since many WooCommerce Host sites attempt to hide information about their server specs and even how many PHP workers they will allow your site to run. The more reputable hosts will often offer a free migration service and even 30 day money back guarantee. We recommend that you do test runs with your WooCommerce Host prior to officially switching from one provider to the next.

4. Work with a Performance Expert (Optional)

If you are unsure about how to tackle a performance issue on your site, we strongly encourage the use of an experienced managed hosting provider that can analyze your site on a continuous basis and determine exactly the amount of PHP workers you need along with CPU considerations.

A performance expert can help you identify specific bottlenecks in your code by using advanced monitoring methods to identify what is going on. They should be able to zoom in and inspect individual PHP processes and database queries to fine tune your site and determine if your unknowingly putting high load on your site’s PHP workers. Sometimes it is not about paying for a larger hosting plan as much as it is evaluating what PHP code is severely impacting your site performance. A WooCommerce performance expert can make these determinations for you and more.

Summary

The goal of maintaining a fast WooCommerce site is maximizing the efficiency of the backend. PHP workers can have a big impact on performance and it is very important to know how many PHP workers you are relying on for your ecommerce site.

The following should be evaluated if your experiencing any site performance issues:

  1. Monitor your site and scale up your PHP workers to satisfy the traffic volume you are dealing with. You must determine if your issue is a lack of PHP workers or not enough CPUs to handle the PHP worker load.
  2. Host your site with a managed hosting provider that is performance focused and will monitor your site 24/7 to ensure that everything is performing well and can auto-scaling your site to boost performance on those occasions that your site has more visitors.
  3. Determine if Object caching is installed on your server. Object caching can help reduce PHP worker load significantly. Determine if your provider is doing this for you or whether you need to introduce something like Redis yourself.
  4. Make sure you are using quality WordPress plugins and themes that are optimized for your database size.