Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
litespeed_wiki:php:lsapi-environment-variables [2019/09/19 20:37]
Shivam Saluja [LSAPI_AVOID_FORK] Memory Limit
litespeed_wiki:php:lsapi-environment-variables [2019/11/22 17:03]
Jackson Zhang
Line 52: Line 52:
 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. 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.
  
-However, if your server has less than 1 GB available memory, just setting ''​LSAPI_AVOID_FORK=1''​ will not work, since LSPHP will only keep the child processes if there is enough available memory which by default is set to 1 GB, If your server has less available memory than that, set it with a limit by replacing it with ``LSAPI_AVOID_FORK=100M''​. This will set a limit for the LSAPI_AVOID_FORK variable and will run as expected.+However, if your server has less than 1 GB available memory, just setting ''​LSAPI_AVOID_FORK=1''​ will not work, since LSPHP will only keep the child processes if there is enough available memory which by default is set to 1 GB, If your server has less available memory than that, set it with a limit by replacing it with ''​LSAPI_AVOID_FORK=100M''​. This will set a limit for the ''​LSAPI_AVOID_FORK'' ​variable and will run as expected. 
 ==== LSAPI_EXTRA_CHILDREN ==== ==== LSAPI_EXTRA_CHILDREN ====
  
Line 60: Line 61:
  
 In ProcessGroup mode, the ''​LSAPI_EXTRA_CHILDREN''​ environment variable controls the maximum number of extra child processes that can be started when existing child processes are malfunctioning. The total number of child processes will be reduced to the level set in ''​LSAPI_CHILDREN''​ as soon as service is back to normal. In ProcessGroup mode, the ''​LSAPI_EXTRA_CHILDREN''​ environment variable controls the maximum number of extra child processes that can be started when existing child processes are malfunctioning. The total number of child processes will be reduced to the level set in ''​LSAPI_CHILDREN''​ as soon as service is back to normal.
 +
 ==== LSAPI_MAX_REQS or PHP_LSAPI_MAX_REQUESTS ==== ==== LSAPI_MAX_REQS or PHP_LSAPI_MAX_REQUESTS ====
  
Line 109: Line 111:
  
 If set to a non-zero number, LiteSpeed Web Server will log requests into an error log file if a request takes longer than the specified number of milliseconds. This can help identify scripts that are slowing down your server. If set to a non-zero number, LiteSpeed Web Server will log requests into an error log file if a request takes longer than the specified number of milliseconds. This can help identify scripts that are slowing down your server.
 +
 +==== LSAPI_CLEAN_SHUTDOWN ====
 +It is avaliable starting PHP LiteSpeed SAPI 7.6. ''​clean shutdown"​ means to clean up if PHP crash or abnormal exit. For example, sometimes PHP 5.x still has strange error due to internal corruption and manually killing PHP process will fix the problem. Now you can use ''​LSAPI_CLEAN_SHUTDOWN''​ environment variable to let lsphp to automatically fix such abnormal crash issue. When set ''​LSAPI_CLEAN_SHUTDOWN=0'',​ it disables ''​clean shutdown'';​ while set ''​ LSAPI_CLEAN_SHUTDOWN=1'',​ it enables ''​clean shutdown''​. For PHP 7.0+, it is set to ''​on''​ by default; For lower versions than PHP 7.0, it is set to be ''​off''​ by default.
  • Admin
  • Last modified: 2023/01/31 20:51
  • by Lisa Clarke