503 Service Unavailable error on a shop hosted on shared cPanel server, apache error log:
2022-04-29 11:04:21.728438 [T0] [22.214.171.124:49768-H3:3D8F707E6843B0DF-0#APVH_XXXXXX.com:443] Max retries has been reached, 503!
2022-04-29 11:04:21.728438 [NOTICE]  [T0] [126.96.36.199:49768-H3:3D8F707E6843B0DF-0#APVH_XXXXXX.com:443] oops! 503 Service Unavailable
2022-04-29 11:04:21.728443 [NOTICE]  [T0] [188.8.131.52:49768-H3:3D8F707E6843B0DF-0#APVH_XXXXXX.com:443] Content len: 0, Request line: ‘GET / HTTP/1.1’
2022-04-29 11:04:21.728448 [INFO]  [T0] [184.108.40.206:49768-H3:3D8F707E6843B0DF-0#APVH_XXXXXX.com:443] abort request…, code: 4
2022-04-29 11:04:21.728499 [INFO]  [T0] [220.127.116.11:49768-H3:3D8F707E6843B0DF-0#APVH_XXXXXX.com:443] File not found [/home/username/public_html/503.shtml]
In my case, the user is hitting these limits because both PHP suEXEC Max Conn and NPROC are set to 100 and user is hitting this number.
So to fix it, there are different options:
- Restart CageFS
- Set PHP suEXEC Max Conn limit lower than NPROC limits
- Disable PHP suEXEC completely
- Change PHP version or handler to something different than suEXEC
If you use Cloudlinux, the first thing to do is to disable CageFS for that user and test if the issue is still present. If not, enable CageFS again and re-test. In 2/3 cases, CageFS is the problem.
Change Suexec limits
Since I also use CloudLinux on this server, I also have to take into consideration the LVE limits and make sure that Suexec limits in LSWS are lower than EP and NPROC limits defined in Cloudlinux.
To change Limits, navigate to LiteSpeed WebAdmin Console at SERVER:7080
From the terminal set a new user/password by running the script:
After logging in the LSWS WebAdmin Console navigate to Server > General > Using Apache Configuration File and set PHP suEXEC Max Conn to a number lower than NPROC:
In my case, NPROC is set to 200, so I will set 45 for suEXEC
Now just restart LSWS and the website should load as expected.
Disable PHP suEXEC
To disable PHP suEXEC server-wide navigate to WHM > LiteSpeed > LiteSpeed configuration
Select PHP suEXEC Quick Configuration
And disable it.
Change PHP version
From WHM > MultiPHP Manager > User Domain Settings find the domain and change the PHP version: