https://docs.litespeedtech.com/lsws/extapp/php/configuration/options
Hi
What is the relationship between LSAPI_AVOID_FORK and LSAPI_MAX_IDLE ?
If setting LSAPI_MAX_IDLE causes an idle process to eventually die, how does LSAPI_AVOID_FORK=1 keep the process alive?
LSAPI_MAX_IDLE¶
Default Value: 300 seconds
In ProcessGroup mode, LSAPI_MAX_IDLE controls how long an idle child process will wait for a new request before it exits. This option helps release system resources taken by idle processes.
Default Value: 300 seconds
In ProcessGroup mode, LSAPI_MAX_IDLE controls how long an idle child process will wait for a new request before it exits. This option helps release system resources taken by idle processes.
LSAPI_AVOID_FORK¶
Default Value: 0
The LSAPI_AVOID_FORK environment variable specifies whether the internal process manager in ProcessGroup mode should try to avoid forking new child processes.
When set to 0, the internal process manager will not try to avoid forking new processes. To save system resources, it will stop processes when they finish and only start child processes when they are needed. This is often preferred in shared hosting.
When set to 1, the internal process manager will try to avoid frequently stopping and starting child processes. This might be preferred in a dedicated hosting environment because it may be faster to recycle existing processes, even if it means sometimes running unused processes.
Note
LSAPI_AVOID_FORK=1 will only keep the child processes alive if there is enough available memory. By default "enough" is set to 1GB, so if your server has less than 1 GB available, setting LSAPI_AVOID_FORK=1 will not work. Instead you can set a limit, as in LSAPI_AVOID_FORK=100M. This will allow the LSAPI_AVOID_FORK variable to work as expected.
Default Value: 0
The LSAPI_AVOID_FORK environment variable specifies whether the internal process manager in ProcessGroup mode should try to avoid forking new child processes.
When set to 0, the internal process manager will not try to avoid forking new processes. To save system resources, it will stop processes when they finish and only start child processes when they are needed. This is often preferred in shared hosting.
When set to 1, the internal process manager will try to avoid frequently stopping and starting child processes. This might be preferred in a dedicated hosting environment because it may be faster to recycle existing processes, even if it means sometimes running unused processes.
Note
LSAPI_AVOID_FORK=1 will only keep the child processes alive if there is enough available memory. By default "enough" is set to 1GB, so if your server has less than 1 GB available, setting LSAPI_AVOID_FORK=1 will not work. Instead you can set a limit, as in LSAPI_AVOID_FORK=100M. This will allow the LSAPI_AVOID_FORK variable to work as expected.
What is the relationship between LSAPI_AVOID_FORK and LSAPI_MAX_IDLE ?
If setting LSAPI_MAX_IDLE causes an idle process to eventually die, how does LSAPI_AVOID_FORK=1 keep the process alive?