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:503-errors [2018/10/01 20:05]
Jackson Zhang [The lsphp process is killed unexpectedly by CSF/LFD]
litespeed_wiki:php:503-errors [2018/11/06 14:27]
Jackson Zhang [CloudLinux Limits Reached]
Line 199: Line 199:
 ==== CloudLinux Limits Reached =====  ==== CloudLinux Limits Reached ===== 
  
-For CloudLinux users, if a site is limited by either the amount of memory or the number of processes, then the user will receive 503 errors because the server cannot execute the script. Increasing the limits on memory and number of processes for that CageFS user may fix the problem.+For CloudLinux users, if a site is limited by either the amount of memory or the number of processes, then the user will receive 503 errors because the server cannot execute the script. Increasing the limits on memory and number of processes for that CageFS user may fix the problem. ​To understand why LVE may cause such error, please refer to [[https://​docs.cloudlinux.com/​index.html?​lve.html|CloudLinux LVE documentation]]. 
 + 
 +  If the site is limited by CPU or IO, then the site will start responding slower. 
 +  If the site is limited by memory or number of processes limits, then the user will recieve 500 or 503 errors that server cannot execute the script. 
  
 ==== PHP memory_limit reached ==== ==== PHP memory_limit reached ====
Line 290: Line 294:
 These settings will need to be adjusted on a per case basis as each scenario will be different. They should be increased slightly higher than the current values until the issue stops occurring. For the changes to take effect, both csf and lfd will need to be restarted. This can either be done via the WHM Plugin or through a shell terminal with the following command: ''​csf -r; service lfd restart''​ These settings will need to be adjusted on a per case basis as each scenario will be different. They should be increased slightly higher than the current values until the issue stops occurring. For the changes to take effect, both csf and lfd will need to be restarted. This can either be done via the WHM Plugin or through a shell terminal with the following command: ''​csf -r; service lfd restart''​
  
-==== Misconfiguration of lsphp external application ​==== +==== Misconfiguration of "lsphp" External Application ​==== 
-During ​the LSWS installation,​ external ​application ​will be automatically set to the best value of the general ​situation. However, sometimes the user intentionally removes ​something which causes misconfiguration and may cause 503 error.+During ​LiteSpeed Web Server ​installation,​ external ​applications ​will be automatically set to the best value for general ​use. However, sometimes the user intentionally removes ​some of these settings. This causes ​misconfiguration and possibly also a 503 error.
  
-For PHP external app, LSWS will normally add the following to it as default.+For PHP external app, LSWS will normally add the following to it by default:
     <​memSoftLimit>​2047M</​memSoftLimit>​     <​memSoftLimit>​2047M</​memSoftLimit>​
     <​memHardLimit>​2047M</​memHardLimit>​     <​memHardLimit>​2047M</​memHardLimit>​
Line 299: Line 303:
     <​procHardLimit>​1500</​procHardLimit>​     <​procHardLimit>​1500</​procHardLimit>​
  
-but some user intentionally ​removed ​the above without any clear purpose. When the resource limit was not set, LSWS will use CGI resource limit as default ​while the CGI resource limit is too low to meet the requirement. If the PHP is configured to have 500 max connectionsit requires to have 500 children ​processes, the process limit needs to be setup to minimum 1000. The above misconfiguration caused 503 error on LSWS. +Imagine a user intentionally ​removes ​the above without any clear purpose. When the resource limit is not set, LSWS will use the CGI resource limit by default, but the CGI resource limit is too low to meet the requirements 
 + 
 +If the user has configured ​PHP to have 500 max connections
 +     <​maxConns>​500</​maxConns>​ 
 + 
 +Then it must have 500 child processes:  
 +     <​env>​PHP_LSAPI_CHILDREN=500</​env>​ 
 + 
 +The "500 max connections"​ setting requires "process limit" ​to be set at a minimum ​of "1000." But since the user incorrectly removed the PHP process limit settings, the above misconfiguration caused ​503 PHP error when running ​LSWS. 
  
-We recommend not to remove anything if you are unsure ​and cause an uncertain problem, ​such as 503 error as this case+We recommend ​that you do not to remove anything if you are unsure, as it can cause an uncertain problem, ​including a 503 error. ​
 ====  Apache and LiteSpeed using unmatched PHPs could cause problems for control panel users ====  ====  Apache and LiteSpeed using unmatched PHPs could cause problems for control panel users ==== 
 If you use a control panel such as cPanel or Plesk, make sure both PHPs for Apache and LiteSpeed are matching each other. To test this, you can create a phpinfo page under your domain and switch between both web servers to check. If these PHPs do not match you could end up with 503 errors. If you use a control panel such as cPanel or Plesk, make sure both PHPs for Apache and LiteSpeed are matching each other. To test this, you can create a phpinfo page under your domain and switch between both web servers to check. If these PHPs do not match you could end up with 503 errors.
  • Admin
  • Last modified: 2020/02/11 14:26
  • by Jackson Zhang