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:detached_mode [2019/02/13 20:45]
Jackson Zhang [PHP Processes Won't Run Forever]
litespeed_wiki:php:detached_mode [2019/07/12 16:09]
Jackson Zhang [For a User]
Line 23: Line 23:
  
 ==== For a User ==== ==== For a User ====
-To restart detached PHP processes for the account (vhost) level, you can touch a ''​.lsphp_restart.txt''​ file under the user's home directory:+To restart detached PHP processes for the account (vhost) level, you can touch a ''​.lsphp_restart.txt''​ file under the user's home directory, such as /​home/​USER1/​ on cpanel/WHM server:
  
   touch <​user_home_dir>/​.lsphp_restart.txt   touch <​user_home_dir>/​.lsphp_restart.txt
 +  ​
 +After the ''​.lsphp_restart.txt''​ was created, the user's PHP should be restarted when next request comes. ​ The file ''​.lsphp_restart.txt''​ won't be removed after the creation. LSWS only checks the timestamp of the file to decide if the user's detached PHP needs to be restarted or not.  You can manually remove it if you want but not necessary. Every time you want to restart that user's detached PHP, you can just touch again no matter it exists or not to refresh the timestamp. ​
   ​   ​
 To make it compatible with CloudLinux mod_lsapi CRIU feature, server will restart PHP by ''​mod_lsapi_reset_me''​ as well  To make it compatible with CloudLinux mod_lsapi CRIU feature, server will restart PHP by ''​mod_lsapi_reset_me''​ as well 
Line 47: Line 49:
  
 ===== PHP Processes Won't Run Forever ===== ===== PHP Processes Won't Run Forever =====
-PHP Detached Mode doesn'​t mean that PHP will run forever. It will still follow the [[https://​www.litespeedtech.com/​docs/​webserver/​config/​extapps/​lsapi#​extMaxIdleTime |Max Idle Time]] setting. If you want to make PHP live longer, just increase **Max Idle Time**. ​ Never set it as "-1" ​to means as "​unlimited"​ since, in process group mode, it will be automatically converted to default 30 seconds. If you want PHP to be running longer, try to enter a large number, such as "3600".+PHP Detached Mode doesn'​t mean that PHP will run forever. It will still follow the [[https://​www.litespeedtech.com/​docs/​webserver/​config/​extapps/​lsapi#​extMaxIdleTime |Max Idle Time]] setting. If you want to make PHP live longer, just increase **Max Idle Time**. ​ Never set it to ''​-1'' ​to indicate ​"​unlimited"​ since, in process group mode, values under ''​30'' ​will be automatically converted to the default ​of 30 seconds. If you want PHP to be running longer, try to enter a large number, such as ''​3600''​. 
 + 
 +===== When Changes Become Effective ===== 
 +Changes to Detached Mode will be effective when the app restarts. 
 + 
 +Remember, the Detached Mode app isn't started when the server starts up. It only starts when there is traffic hitting the external app. It will be started on demand, and remain running even if LSWS restarts.
  
 +The same for the restart. Only if an external application is about to serve a request, will it be checked and restarted if needed.
 ===== PHP Auto Configuration for Different Control Panels ===== ===== PHP Auto Configuration for Different Control Panels =====
 In previous versions of LSWS (5.2.x and earlier), external apps and PHP handlers are set up via the **External App** and **Script Hander** sections, respectively. In previous versions of LSWS (5.2.x and earlier), external apps and PHP handlers are set up via the **External App** and **Script Hander** sections, respectively.
  • Admin
  • Last modified: 2020/02/26 22:53
  • by Lucas Rolff