Max retries has been reached, 503!

Max retries has been reached, 503!

image 123 - Max retries has been reached, 503!

503 Service Unavailable error on a shop hosted on shared cPanel server, apache error log:

tail /usr/local/apache/logs/error_log

2022-04-29 11:04:21.728438 [T0] [31.32.33.34:49768-H3:3D8F707E6843B0DF-0#APVH_XXXXXX.com:443] Max retries has been reached, 503!
2022-04-29 11:04:21.728438 [NOTICE] [186810] [T0] [31.32.33.34:49768-H3:3D8F707E6843B0DF-0#APVH_XXXXXX.com:443] oops! 503 Service Unavailable
2022-04-29 11:04:21.728443 [NOTICE] [186810] [T0] [31.32.33.34: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] [186810] [T0] [31.32.33.34:49768-H3:3D8F707E6843B0DF-0#APVH_XXXXXX.com:443] abort request…, code: 4
2022-04-29 11:04:21.728499 [INFO] [186810] [T0] [31.32.33.34:49768-H3:3D8F707E6843B0DF-0#APVH_XXXXXX.com:443] File not found [/home/username/public_html/503.shtml]

image 120 1024x269 - Max retries has been reached, 503!

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:

  1. Restart CageFS
  2. Set PHP suEXEC Max Conn limit lower than NPROC limits
  3. Disable PHP suEXEC completely
  4. Change PHP version or handler to something different than suEXEC

Restart CageFS

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.

chrome U37LhyiyQ6 - Max retries has been reached, 503!

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

image 125 - Max retries has been reached, 503!

From the terminal set a new user/password by running the script:

/usr/local/lsws/admin/misc/admpass.sh
image 124 - Max retries has been reached, 503!

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:

image 121 - Max retries has been reached, 503!

In my case, NPROC is set to 200, so I will set 45 for suEXEC

image 122 1024x236 - Max retries has been reached, 503!

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

image 129 - Max retries has been reached, 503!

Select PHP suEXEC Quick Configuration

image 127 - Max retries has been reached, 503!

And disable it.

image 128 1024x354 - Max retries has been reached, 503!

Change PHP version

From WHM > MultiPHP Manager > User Domain Settings find the domain and change the PHP version:

image 126 1024x700 - Max retries has been reached, 503!
whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.