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 [2018/09/19 16:14]
Michael Alegre [LSAPI_ACCEPT_NOTIFY]
litespeed_wiki:php:lsapi-environment-variables [2019/01/10 20:49]
Jackson Zhang [LSAPI_CHILDREN or PHP_LSAPI_CHILDREN]
Line 40: Line 40:
 Setting ''​LSAPI_CHILDREN''​ to ''​1''​ puts LSWS in Worker mode. In Worker mode, LiteSpeed Web Server dynamically spawns new PHP processes to meet demand and kills finished processes. In this mode, an external application'​s Instances setting under **Configuration > External App > your_external_application** should match the **Max Connections** setting in the same location. Setting ''​LSAPI_CHILDREN''​ to ''​1''​ puts LSWS in Worker mode. In Worker mode, LiteSpeed Web Server dynamically spawns new PHP processes to meet demand and kills finished processes. In this mode, an external application'​s Instances setting under **Configuration > External App > your_external_application** should match the **Max Connections** setting in the same location.
  
-Setting ''​LSAPI_CHILDREN''​ to ''​1''​ puts LSWS in ProcessGroup mode. In ProcessGroup mode, the web server will start one constantly-running PHP parent process. This process will then fork child PHP processes (as opposed to spawning new processes) to meet demand. ProcessGroup mode is generally preferred because all PHP processes can then share one memory block for opcode caching. In ProcessGroup mode, **Instances** should be set to ''​1'',​ while ''​LSAPI_CHILDREN''​ should be set to match the value of **Max Connections**.+Setting ''​LSAPI_CHILDREN''​ to ''​a number larger than 1''​ puts LSWS in ProcessGroup mode. In ProcessGroup mode, the web server will start one constantly-running PHP parent process. This process will then fork child PHP processes (as opposed to spawning new processes) to meet demand. ProcessGroup mode is generally preferred because all PHP processes can then share one memory block for opcode caching. In ProcessGroup mode, **Instances** should be set to ''​1'',​ while ''​LSAPI_CHILDREN''​ should be set to match the value of **Max Connections**.
  
 ==== LSAPI_AVOID_FORK ==== ==== LSAPI_AVOID_FORK ====
Line 103: Line 103:
 ==== LSAPI_ACCEPT_NOTIFY ==== ==== LSAPI_ACCEPT_NOTIFY ====
  
-By default, an LSAPI application will send back a notification packet whenever a request has been received. As of PHP LSAPI v5.0, it can be changed to only notify the server for newly established connections by setting this environment variable to ''​1''​. ​It is recommended as a way to gain performance in LiteSpeed Web Server ​4.1 and later.+By default, an LSAPI application will send back a notification packet whenever a request has been received. As of PHP LSAPI v5.0, it can be changed to only notify the server for newly established connections by setting this environment variable to ''​1''​. ​This is recommended as a way to gain performance in LiteSpeed Web Server ​v4.1 and later.
  
 ==== LSAPI_SLOW_REQ_MSECS ==== ==== LSAPI_SLOW_REQ_MSECS ====
  
 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.
  • Admin
  • Last modified: 2023/01/31 20:51
  • by Lisa Clarke