Start a conversation

All websites are not available: 504 gateway timeout

Symptoms 

All websites are not available with the following error: 

504 gateway timeout

Apache, Nginx, and PHP-FPM services are marked as running in Plesk > Tools & Settings > Services Management. Server's load average is huge:

#w 

12:19:38 up 1 day, 3:49, 0 users, load average: load average: 200.75, 92.44, 36.55. USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT ...

There are two main Apache services started and abnormally large number of child Apache processes for main Apache service which is newer. 

#ps -e f | grep "httpd\|apache2" 

www-data 21372 0.0 0.0 2332044 5596 ? Sl Jul28 26:28 /usr/sbin/apache2 -k start. root 9716 0.1 0.3 358524 108388 ? Ss 18:42 0:02 /usr/sbin/apache2 -k start. www-data 9722 0.0 0.2 356392 97960 ? S 18:42 0:00 \_ /usr/sbin/apache2 -k start. www-data 9723 0.0 0.3 358976 106800 ? S 18:42 0:00 \_ /usr/sbin/apache2 -k start. www-data 9724 0.0 0.3 359028 106060 ? S 18:42 0:00 \_ /usr/sbin/apache2 -k start. www-data 9725 0.0 0.3 358928 106704 ? S 18:42 0:00 \_ /usr/sbin/apache2 -k start. www-data 9726 0.0 0.3 358816 106548 ? S 18:42 0:00 \_ /usr/sbin/apache2 -k start. www-data 9790 0.0 0.3 358892 106748 ? S 18:42 0:00 \_ /usr/sbin/apache2 -k start. ... 

The Cause

Abnormally large number of child Apache processes.

The Fix

Warning: the resolution applicable only if ALL websites are down.

1. Connect to the server via SSH.

2. Stop all Apache services:

    CentOS #killall httpd

    Debian #killall apache2

3. Log in to Plesk

4. Go Plesk > Tools & Settings > Services Management and stop PHP handler service.

5. Wait few minutes till load average became low.

6. Go Plesk > Tools & Settings > Services Management and start Web Server (Apache) and necessary PHP-FPM handler services.

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Fastcomcorp

  2. Posted
  3. Updated

Comments