Author Topic: 503 Service Unavailable  (Read 6336 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
503 Service Unavailable
« on: June 24, 2021, 06:04:55 PM »
Hello,

I hope you're doing well,

I've installed PHP FPM 7.4, And I've set this configurations for each user :

pm = dynamic
pm.max_children = 150
pm.start_servers = 20
pm.min_spare_servers = 10
pm.max_spare_servers = 20
pm.max_requests = 0
request_terminate_timeout = 0

For Apache :

Timeout 86400
ProxyTimeout 86400

And :

<IfModule proxy_fcgi_module>
    ProxyTimeout 86400

   <FilesMatch \.php$>
      SetHandler "proxy:unix:/opt/alt/php-fpm74/usr/var/sockets/user.sock|fcgi://localhost"
   </FilesMatch>
</IfModule>

But the script exicuted for 120-240 seconds and I got that message : Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

I've worked already with same configs but I don't know what happened :(

Please help me to solve this problem,

Thank you,

Offline
*
Re: 503 Service Unavailable
« Reply #1 on: June 25, 2021, 07:34:17 AM »
if you are using nginx then you would need to edit nginx conf also.
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
*****
Re: 503 Service Unavailable
« Reply #2 on: June 25, 2021, 07:37:18 AM »
Are you using Apache only or Nginx, or a combo?

If Apache only, 503 error usually means you did not setup proxy app correctly. What is output of

cat /usr/local/apache/logs/error_log | grep :error

Do you have any users that you didn't apply this configuration to?

Are those sites working OK?

Offline
*
Re: 503 Service Unavailable
« Reply #3 on: June 25, 2021, 12:35:36 PM »
Hello again,

Thank you all for your reply,

I use apache only with php fpm ..

For the error logs I got :

Code: [Select]
[Fri Jun 25 14:30:53.169518 2021] [proxy_fcgi:error] [pid 31228:tid 140611063580416] [client 160.177.150.239:10610] AH01067: Failed to read FastCGI header
[Fri Jun 25 14:30:53.169605 2021] [proxy_fcgi:error] [pid 31228:tid 140611063580416] (104)Connection reset by peer: [client 160.177.150.239:10610] AH01075: Error dispatching request to :

I exicute script correctly, but after 240 seconds I got *Service Unavailable* even I've set 84000 as a timeout for apache & for proxy_fcgi_module and I've disabled :

Code: [Select]
#LoadModule reqtimeout_module modules/mod_reqtimeout.so
Thank you
« Last Edit: June 25, 2021, 12:39:25 PM by AltairMed »

Offline
*****
Re: 503 Service Unavailable
« Reply #4 on: June 25, 2021, 05:05:10 PM »
Are you using WordPress?

If so, make sure you are running only 1 version of PHP-FPM.

Also in your php.ini, make sure opcache.fast_shutdown=0 is not commented out. By Default it is.
« Last Edit: June 25, 2021, 05:13:04 PM by Starburst »

Offline
*
Re: 503 Service Unavailable
« Reply #5 on: June 25, 2021, 08:09:33 PM »
Hello Starburst,

Thank you for your reply,

No, I don't use Wordpress, I work on a web crawler and I want it to work all time ..

My VPS :

CPU Model: AMD EPYC 7282 16-Core Processor
CPU Details: 10 Core (2800 MHz)
RAM: 60 GBs


For opcache.fast_shutdown=0 I did not installed it ..

I really don't know what happened :(


Offline
*****
Re: 503 Service Unavailable
« Reply #6 on: June 25, 2021, 11:18:44 PM »
Is opcache.fast_shutdown=0 uncommented in the php.ini?

Be default it is commented out.

Also check out:
https://bobcares.com/blog/apache-error-failed-to-read-fastcgi-header/

Other than that I'm out of ideas.  ???