504 Gateway Timeout

Hello,

An error occur with my site if I switch it to PHP-FPM 8 instead PHP-FPM 7.4:

[Fri Oct 29 19:20:22.877061 2021] [proxy_fcgi:error] [pid 322961:tid 140681024620288] (70007)The timeout specified has expired: [client 77.220.212.27:0] AH01075: Error dispatching request to : (polling), referer: https://www.mydomain.com/
[Fri Oct 29 19:21:24.273689 2021] [proxy_fcgi:error] [pid 322961:tid 140680907187968] [client 77.220.212.27:0] AH01067: Failed to read FastCGI header, referer: https://www.mydomain.com/
[Fri Oct 29 19:21:24.273716 2021] [proxy_fcgi:error] [pid 322961:tid 140680907187968] (104)Connection reset by peer: [client 77.220.212.27:0] AH01075: Error dispatching request to : , referer: https://www.mydomain.com/

In php.ini I have these values:

max_execution_time = 600
max_input_time = 120
memory_limit = 4096M
post_max_size = 8M
upload_max_filesize = 20M
max_file_uploads = 20
default_socket_timeout = 180
# cat /etc/apache2/apache2.conf
[…]

# Global configuration
PidFile ${APACHE_PID_FILE}
Timeout 180
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 10

In idea to resolve this issu? (it produice when I recreate the cache in my CMS (Drupal 9))

Thanks

Check also Nginx it also has a timeout

Hi eris,

I have these value:

# cat /etc/nginx/nginx.conf | grep timeout
    client_header_timeout           180s;
    client_body_timeout             180s;
    send_timeout                    60s;
    keepalive_timeout               30s;
    fastcgi_connect_timeout         30s;
    fastcgi_read_timeout            300s;
    fastcgi_send_timeout            180s;
    fastcgi_cache_lock_timeout      5s;
    proxy_connect_timeout           30s;
    proxy_read_timeout              300s;
    proxy_send_timeout              180s;
    ssl_session_timeout 60m;
    resolver_timeout    5s;
    proxy_cache_use_stale error timeout invalid_header http_502;
    fastcgi_cache_use_stale updating error timeout invalid_header http_500 http_503;

I edit what line? Thx

In php:
max_execution_time = 600

In apache2:
Timeout 180

In Nginx:
proxy_read_timeout 300s;

Make sure they are equal

For Drupal it probabbly possible to generate cache via CLI and will all bypass this miss

Or, I have made these values equal.

Sure, I use ‘drush cr’ in CLI.

Well I have increase these values:

proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;

But the result is the same. Then I have think I little more, and change JShrink by JSqueeze for my js compressor, in Drupal admin.

Now it works.