When it comes time to choosing a hosting plan, it’s important you pick one that will best match the demands of your WordPress site. For example, an ecommerce site that gets 50,000 visitors per month is typically going to be a lot more demanding than a blog with the same amount of traffic. This is simply due to the fact that many ecommerce sites are dynamic and have a lot of uncached responses and larger queries.
And that is where PHP workers come into play. Read more below about what PHP workers are and how they are used to speed up processing of requests on your site.
PHP workers determine how many simultaneous requests your site can handle at a given time. To put it simply, each uncached request for your website is handled by a PHP Worker.
For example, if you have 4 requests that come to your site at the exact same time and your site has 2 PHP workers, two of those requests will get processed while the other two will have to wait in the queue until the first two have finished processing.
If your site is highly optimized or does not have a lot of PHP code (e.g., a complex theme or a lot of WordPress plugins), then processing each request should happen almost instantly, so even with 2 PHP workers and 4 requests, all four requests would be handled very quickly.
We implement server-level caching so in many cases requests are served lightning fast from cache. However, for sites in which the cache is bypassed or missed, PHP workers become very important as they have to do work for each request. Typically we see a lot of uncached requests on ecommerce and community sites. Therefore, these sites will typically require additional PHP workers to ensure every request is processed without delays and completed successfully.
Result of Not Enough PHP Workers
When PHP workers are already busy on a site, they start to build up a queue. Once you’ve reached your limit of PHP workers, the queue starts to push out older requests which could result in 504 errors or incomplete requests. There are a lot of different things that could cause this, such as a slow uncached request from a plugin that ties up more of your PHP workers. In this case, additional PHP workers per site would help solve this problem, as they allow for multiple requests to execute simultaneously.
Still confused? Think of each PHP worker like a ticket cashier at a stadium. The cashier can only help one person at a time. But if you have multiple ticket cashiers then more people can be helped simultaneously. The problem is when people take a too long asking a lot of questions (slow uncached requests), it delays the other people.
Another common error we see due to the lack of PHP workers is 502 bad gateway errors. These are slightly different than 504 errors because the error occurs after a timeout of 60 seconds in the PHP workers queue.
Estimating Number of PHP Workers
Each of the hosting plans at Kinsta includes a certain number of PHP workers. The number included is based on resource usage we have seen with clients over past couple years. In general, sites with lots of static content – articles, static pages, blog posts – don’t need many PHP workers.
4 PHP workers are usually enough for larger WordPress sites. However, this can vary per site as each one will have its own unique set of third-party plugins, queries, dynamic content, and number of cached vs uncached responses. So in some cases, the more PHP workers the better.
You can use the cache analysis reports in MyKinsta analytics to determine how many total requests are currently serving from the cache vs bypassing it, along with the top cache bypass requests.
Top cache bypasses
If you have any questions regarding how many PHP workers you might need, or you think you might be seeing errors due to the lack of PHP workers, please open a ticket with our support team for assistance.
A cookie is a piece of information that a website stores on a visitor’s computer. We use this for some functionality on our website to work properly, and also to collect analytics to better understand our visitors and offer them a better experience. You can accept all cookies at once or fine-tune your preferences in the cookie settings.
Thanks, we've saved your settings, you can modify them any time on the cookie settings page
These cookies are needed for our website to function providing payment gateway security and ther essentials. Therefore they are always on but they do not contain personally identifiable information (PII).
If you've set preferences (which cookies you accept and which you don't) we store your preferences here to make sure we don't load anything that you didn't agree to.
WordPress sets a couple of cookies that track logged in users and store user preferences set in their WordPress user profile. These are set for members of the Kinsta website only - members of our staff.
Stripe is our payment provider and they may set some cookies to help them with fraud prevention and other issues. This is required for our payments to work.
This cookie contains information about the affiliate who refered a visitor. The cookie contains no information about the visitor whatsoever.
Analytics help us deliver better content to our audience. We have made sure no personally identifiable information (PII) is sent by anonymizing IPs.
Analytics cookies allow us to gather data to help us better understand our visitors and offer them a better experience.
Set and used by Hotjar. We use Hotjar to analyze user behavior without identifying the user.
Marketing cookies help us target our ads better. We mainly use them to target ads to users who have visited Kinsta.
Set and used by Twitter, used for targeting advertisements and promoting content to users who have visited kinsta.com.
Set and used by AdRoll for remarketing and targeting advertisements to users who have visited kinsta.com.
Set and used by Facebook, used for targeting advertisements and promoting content to users who have visited kinsta.com.
Set and used by Quora, used for targeting advertisements to users who have visited kinsta.com.