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
litespeed_wiki:php:process-mode [2018/09/21 17:33]
Michael Alegre [Benefits]
litespeed_wiki:php:process-mode [2018/09/24 18:08] (current)
Michael Alegre [Benefits]
Line 35: Line 35:
 </​code>​ </​code>​
  
-Note the two LiteSpeed-specific directives ''​[[litespeed_wiki:​php:​lsapi-environment-variables#​lsphp_processgroup|LSPHP_ProcessGroup]]''​ and ''​[[litespeed_wiki:​php:​lsapi-environment-variables#​lsphp_workers|LSPHP_Workers]]''​. Apache will not understand these directives and may crash if it encounters outside of by an ''<​IfModule LiteSpeed>''​ block.+Note the two LiteSpeed-specific directives ''​[[litespeed_wiki:​php:​lsapi-environment-variables#​lsphp_processgroup|LSPHP_ProcessGroup]]''​ and ''​[[litespeed_wiki:​php:​lsapi-environment-variables#​lsphp_workers|LSPHP_Workers]]''​. Apache will not understand these directives and may crash if it encounters ​them outside of by an ''<​IfModule LiteSpeed>''​ block.
  
 ==== Configuration tips ==== ==== Configuration tips ====
Line 65: Line 65:
  
 ==== Limitations ==== ==== Limitations ====
-  * Daemon mode does not allow the use of custom per-user php.ini files. As a result, LiteSpeed Web Server will automatically switch to [[#​worker_mode|Worker mode]] at the Server level if a custom php.ini file is detected.+  * Daemon mode does not allow the use of custom per-user php.ini files. As a result, LiteSpeed Web Server will automatically switch to [[#​worker_mode|Worker mode]] at the Server level if it detects ​a custom php.ini file.
   * Due to it's incompatibility with custom php.ini files, Daemon mode is not compatible with CloudLinux'​s PHP Selector.   * Due to it's incompatibility with custom php.ini files, Daemon mode is not compatible with CloudLinux'​s PHP Selector.
  
Line 77: Line 77:
 ==== Benefits ==== ==== Benefits ====
   * Worker mode is compatible with custom php.ini files including CloudLinux’s CageFS php.ini files, allowing the use of CloudLinux'​s PHP Selector. ​   * Worker mode is compatible with custom php.ini files including CloudLinux’s CageFS php.ini files, allowing the use of CloudLinux'​s PHP Selector. ​
-  * When running PHP using a suEXEC execution method, ​Worker mode will conserve resources by killing processes that have been idle too long. This is more efficient than Apache + PHP-FPM where at least one process is always running in each user's pool.  ​+  * Worker mode conserves resources by killing idle processes. ​When running PHP using a suEXEC execution method, ​this is more efficient than Apache + PHP-FPM where at least one process is always running in each user's pool.  ​
  
 ==== Limitations ==== ==== Limitations ====
-  * Worker mode will create ​a new PHP process when needed. This results ​in the process'​s opcode cache flushing ​each time the processes exits, making ​Worker mode incompatible with opcode and APCu caching. For this reason, ​it is recommended to only use Worker mode if custom.php files are needed but server resources are too limited for [[#​processgroup_mode|ProcessGroup mode]].+  * Worker mode creates ​a new PHP process when needed, resulting ​in the process'​s opcode cache flushing ​when the processes exits. This makes Worker mode incompatible with opcode and APCu caching. For this reason, ​you should ​only use Worker mode if you need custom php.ini files and server resources are too limited for [[#​processgroup_mode|ProcessGroup mode]].
   * Creating a new processes has more overhead than forking child processes. This may cause Worker mode to be slightly slower than [[#​daemon_mode|Daemon]] or [[#​processgroup_mode|ProcessGroup]] modes. This overhead can be greatly reduced by running in [[#​daemon_mode|Daemon mode]] by setting **Start By Server** to ''​Yes (Through CGI Daemon)''​ or ''​Yes (Through CGI Daemon Async)''​ under **Configuration > External App > your_external_application**.   * Creating a new processes has more overhead than forking child processes. This may cause Worker mode to be slightly slower than [[#​daemon_mode|Daemon]] or [[#​processgroup_mode|ProcessGroup]] modes. This overhead can be greatly reduced by running in [[#​daemon_mode|Daemon mode]] by setting **Start By Server** to ''​Yes (Through CGI Daemon)''​ or ''​Yes (Through CGI Daemon Async)''​ under **Configuration > External App > your_external_application**.
  
 ==== Setup ==== ==== Setup ====
-Worker mode will be used when none the setting requirements for [[#​processgroup_mode|ProcessGroup mode]] (default) or [[#​daemon_mode|Daemon mode]] have been met. LiteSpeed Web Server may also automatically switch to Worker mode at the Server level if a custom php.ini file is detected when running in [[#​daemon_mode|Daemon mode]].+LiteSpeed Web Server will use Worker mode when none of the setting requirements for [[#​processgroup_mode|ProcessGroup mode]] (default) or [[#​daemon_mode|Daemon mode]] have been met. LiteSpeed Web Server may also automatically switch to Worker mode at the Server level if it detects ​a custom php.ini file while running in [[#​daemon_mode|Daemon mode]].
  
 ===== Mode Comparison ===== ===== Mode Comparison =====
Line 92: Line 92:
 ^ Number of parent processes ​                       |  One for each process group\\ (each user)  |  1  |  0  | ^ Number of parent processes ​                       |  One for each process group\\ (each user)  |  1  |  0  |
 ^ Customize number of processes per account? |  Yes  |  Yes  |  Yes  | ^ Customize number of processes per account? |  Yes  |  Yes  |  Yes  |
-^ Can be enabled ​only for certain virtual hosts? |  Yes  |  No  |  No  |+^ Can enable ​only for certain virtual hosts? |  Yes  |  No  |  No  |
 ^ Custom php.ini supported? (Including CageFS custom php.ini) |  Yes  |  No  |  Yes  | ^ Custom php.ini supported? (Including CageFS custom php.ini) |  Yes  |  No  |  Yes  |
 ^ Opcode caching |  Dedicated per user  |  Shared throughout server ​ |  No  | ^ Opcode caching |  Dedicated per user  |  Shared throughout server ​ |  No  |
  
  • Admin
  • Last modified: 2018/09/21 17:33
  • by Michael Alegre