PHP workers are processes that execute PHP code concurrently, improving the performance and scalability of web applications. When creating your server in xCloud or updating a new PHP version, xCloud adjusts PHP workers count automatically based on the RAM and CPU core available on your server specification.
xCloud provides you the flexibility to set the number of PHP workers to your exact needs from your dashboard. You can find the recommended number of workers count later in this documentation. Optimizing workers can significantly impact your website’s performance, speed, and reliability.
How Do You Adjust PHP Workers in xCloud? #
Following the steps below, you can effectively manage PHP workers to meet your website’s specific requirements.
Note: Incorrectly configuring workers count in PHP can affect your website’s performance. It is essential to carefully consider your server’s resources and workload before adjusting.
Step 1: Access Your Site in xCloud #
To adjust the PHP workers of your site, first, log in to your xCloud dashboard. Then, head over to the โSitesโ, and choose the website to navigate to the selected siteโs โOverviewโ page where you want to make the changes.
Step 2: Access PHP Settings #
From the websiteโs โOverviewโ page, click on the ‘Settings‘ tab from the left panel.
Step 3: Adjust the Number of PHP Workers #
In the PHP Settings, set the maximum workers limit in the โMax PHP Workersโ section considering your site traffic, server’s RAM and CPU resources and click on โSave Settingsโ.
Note: We recommend allocating max 1 worker per 256MB of RAM and 4 workers per CPU core to avoid overflow and underflow. When adjusting automatically xCloud follows this calculation.
That is how you adjust PHP workers in xCloud to enhance your website’s speed, reliability, and user experience.
Determining the Optimal Number of Workers in xCloud #
While the exact number of PHP workers needed varies for each website, understanding your website’s specific requirements can help you find the optimal configuration. Here is how:
Consider Website Type And Workload #
Different website types have varying demands on workers. Here are some general recommendations to get you started (remember, testing and customization are crucial)
- Low-Traffic Websites (Blogs, Portfolios): Begin with a conservative number, like 2 to 3 static workers per CPU core.
- Medium-Traffic Websites (E-commerce Stores): For moderate traffic, consider starting with 3 to 4 static workers per CPU core. Websites with complex product catalogs or high user interaction might require further adjustments.
- High-Traffic Websites (Forums, Social Networks): These resource-intensive websites might benefit from a wider range (4 to 8+ workers) depending on the complexity of user interactions and database operations.
Before changing the PHP worker count, a thorough assessment of your server’s capacity and workload is recommended.
Emphasize Testing And Monitoring #
A data-driven approach is key. Here are some valuable strategies:
- Test incrementally: Increase workers gradually (e.g., +1 per core) and monitor website performance after each change. Use tools like Google PageSpeed Insights or Load Impact to evaluate website speed and identify bottlenecks.
- Analyze Resource Utilization: Keep an eye on server resources like CPU and RAM usage within the xCloud dashboard. Too many workers can lead to resource exhaustion, negatively impacting performance.
Note: PHP worker adjustment is only available NGINX servers. Because OpenLiteSpeed uses a different approach to handling PHP requests compared to NGINX. While NGINX typically relies on PHP-FPM (FastCGI Process Manager), which allows for the adjustment of PHP worker processes (or pools), OpenLiteSpeed integrates PHP directly using its own PHP process management mechanism.
Still stuck! Contact our dedicated support team for assistance with your queries.