-
Notifications
You must be signed in to change notification settings - Fork 7
Description
PHP related change. Possibly add as a new page to a PHP runtime service section. Below is a description of what it does,
Configuring php-fpm Parameters in zerops.yml
1. Introduction
In zerops.yml, you can customize the configuration of php-fpm processes using environment variables. This allows you to optimize your application’s performance without modifying the server's core configuration.
2. Default Mode: dynamic
The dynamic mode is the default process management strategy for php-fpm. In this mode, the system automatically adjusts the number of processes based on current load.
- Environment variables and their default values:
PHP_FPM_PM=dynamicPHP_FPM_PM_MAX_CHILDREN=20PHP_FPM_PM_START_SERVERS=2PHP_FPM_PM_MIN_SPARE_SERVERS=1PHP_FPM_PM_MAX_SPARE_SERVERS=3PHP_FPM_PM_MAX_SPAWN_RATE=32PHP_FPM_PM_MAX_REQUESTS=500
These values can be adjusted according to your requirements directly in zerops.yml.
3. Optional Mode: ondemand
The ondemand mode can be enabled by setting the PHP_FPM_PM variable to ondemand. This mode is ideal for applications with lower traffic, where processes are created only upon incoming requests.
- Additional parameters:
PHP_FPM_PM_PROCESS_IDLE_TIMEOUT=60s(time after which idle processes are terminated)
Other parameters (e.g., PHP_FPM_PM_MAX_CHILDREN) behave similarly to the dynamic mode.
4. Applying Changes
To update the configuration:
- Add or modify the environment variables in your zerops.yml file.
- Restart or reload the service for the changes to take effect.
For a detailed explanation of php-fpm parameters and modes, refer to the official php-fpm documentation.