FAQs
pm.max_requests int. The number of requests each child process should execute before respawning. This can be useful to work around memory leaks in 3rd party libraries. For endless request processing specify '0'.
How to improve PHP-FPM performance? ›
PHP-FPM TUNING
- Start by checking the current configuration settings by running the command php-fpm -i. ...
- Increase the number of processes by editing the pm. ...
- Adjust the amount of memory allocated to each process by editing the pm.
What is the memory limit for PHP-FPM? ›
The limit is currently 128 MB for all versions of PHP. Regardless of which calculation is used for WEB_CONCURRENCY , there's a linear correlation between the PHP memory_limit and the number of PHP-FPM child processes.
How to calculate PM max_children? ›
Calculate pm. max_children setting
- Figure out the amount of RAM used for PHP - roughly, total server RAM minus database RAM and other non-PHP processes.
- Figure out the average process size.
- Divide RAM for PHP (in Mb) by Avg process size (in Mb)
How many PHP-FPM workers are there? ›
This limit is calculated as follows: number of vCPU cores * 5 . For example, if you have a 2XL container with 8 CPU cores, you can have up to 40 workers as long as you have sufficient memory. To adjust the maximum number of PHP-FPM workers depending on your app's needs, follow the instructions on this page.
What is the alternative to PHP-FPM? ›
HHVM (HipHop Virtual Machine), PHP, NGINX, uWSGI, and JavaScript are the most popular alternatives and competitors to PHP-FPM. Powerful collaboration, review, and code management for open ... Powerful collaboration, review, and code management for open ...
Is PHP-FPM faster than Mod_php? ›
Results of Performance Benchmarks
You can notice that PHP-FPM made our test website almost 350% faster when it comes to loading times. Plus, it made the site twice as resource-efficient as it was with mod_php.
Is PHP-FPM good? ›
PHP-FPM is an efficient method on how to minimize the memory consumption and rise the performance for the websites with heavy traffic. It is significantly faster than traditional CGI-based methods in multi-user PHP environments.
What is the difference between PHP-FPM and PHP swoole? ›
Unlike traditional PHP applications that use PHP-FPM, Swoole runs as a continuous process that serves HTTP requests statefully. Instead of booting, then disposing of, an application instance for every request, Swoole keeps a unique instance in memory to serve all the incoming traffic.
What is the highest PHP memory limit? ›
The default memory limit is 256M, which is usually more than sufficient for most needs. If you need to raise this limit, you must create a phprc file.
The following minimum hardware specifications are required for each node running NGINX Controller: RAM: 8 GB RAM. CPU: 8-Core CPU @ 2.40 GHz or similar. Disk space: 155–255 GB free disk space.
How do I increase my PHP memory limit? ›
Using an FTP Client
- Connect to the server with your FTP client. ...
- Navigate to the public_html folder.
- Download the php. ...
- Open the file with any text editor.
- Search for memory_limit without the quotes.
- Enter the new memory limit for your PHP applications.
- Save the file.
- Upload the file using your FTP client.
How to check PHP-FPM memory usage? ›
Analyze the PHP script that is causing the issue to determine why it is using so much memory. This can be done by adding debug statements to the PHP script or using a profiler tool such as Xdebug to generate a memory usage report.
What happens when PM Max_children is reached? ›
Max_children refers to the maximum number of concurrent PHP-FPM processes allowed to exist in such a pool. If the volume of incoming requests requires the creation of more PHP-FPM processes than the number allowed by the max_children limit, those additional requests are backlogged in a queue to await service.
What is PHP-FPM used for? ›
PHP-FPM, or “PHP FastCGI Process Manager,” is an advanced, high-performance FastCGI process manager for PHP. It resolves the concurrency issue of PHP's built-in server by spawning multiple workers, which can handle multiple requests simultaneously.
What is the max children setting? ›
The PHP-FPM limit, often referred to as max_children, refers to the setting that designates the maximum number of concurrent PHP-FPM processes allowed to run on a server.
How to increase PM Max_Children? ›
Then set pm. max. children to a value that your server is used at its best (it means, mainly, optimal RAM use without swapping). If, then, you still reach max_children then it just means you should either upgrade your server, load balance with another server, or optimize your application.
How to get max child process size? ›
Calculate max_children
- pm.max_children = Total RAM dedicated to the web server / Max child process size.
- System RAM: 2GB.
- Average Pool size: 85Mb.
- pm.max_children = 1500MB / 85MB = 17.