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 some 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
Hosts | PHP Workers | Comments |
InMotion | Up to 8 PHP-FPM Workers | Very scalable options compared to other hosts and ranks as a top performing host. |
Nexcess | Starts from 10 PHP workers to 50 PHP workers with an enterprise plan | Very scalable options compared to other hosts and ranks as a top performing host. |
Siteground | Starts 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 small to midsize operations. |
Pressable | Scalable to 100 PHP workers | Proven top performing hosting provider with scalable options for larger companies. |
CloudWays | Unlimited PHP workers | Provider 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. Case in point, this provider has traditionally underperformed many other hosting provider benchmark tests. |
Kinsta | Offers 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 some of our clients have reported it to actually be slower than other providers. Kinsta can offer more PHP workers, but they reserve it to their high-end custom plans that start at $1000/month or more. |
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 has no meaning. 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 likely 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 16 PHP workers to start with is best. But again, this can be a misleading number if your server does not have the adequate memory for multiple workers to run simultaneously.
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, the use of a persistent object cache is the most important and beneficial of the two.
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.
PHP Workers should not be the only factor in website performance you should focus on. For a broader explanation of the main factors that contribute to a super fast website, please read our article Best Practices for a Successful Fast WooCommerce Site