Gateway Timeout 504 - Website doesn’t load

Keywords: WordPress - AWS - Technical issue - Services (Apache, MariaDB, MySQL…)

bndiagnostic ID: 483655f3-02f1-a0fd-0193-4a3b39ef2528

bndiagnostic output:

? Apache: Found possible issues
? Connectivity: Found possible issues
? Wordpress: Found possible issues

bndiagnostic failure reason: The tool could not find any issue

I have a basic setup:

EFS - WP files
ELB - Auto Scaling
2 Instances
a) Bastion
b) t3a.xlarge-WP X 2
2 memcache servers
I am using t3a.xlarge because of the memory usage and to handle connections before the second server boots up.

I have no traffic to website and yet its not loading. I checked the status, it works fine and all the processes are up and running.

I tried sudo service bitnami restart but of no use.

Hi @NFC,

Please check this other post with some information about some errors you have in the Apache’s and PHP’s log files.

and please review the permissions configuration

How can I add in /opt/bitnami/apache2/conf/httpd.conf

Timeout 600
ProxyTimeout 600

I increased the below from 200 to 500 in /opt/bitnami/php/etc/memory.conf


I added the timeout and ProxyTimeout to /opt/bitnami/apache2/conf/httpd.conf

I run the following commands too but the Gateway error is not sorted yet.

sudo chown -R bitnami:daemon /opt/bitnami/wordpress
sudo find /opt/bitnami/wordpress -type d -exec chmod 775 {} \;
sudo find /opt/bitnami/wordpress -type f -exec chmod 664 {} \;
sudo chown -R bitnami:daemon /bitnami/wordpress
sudo find /bitnami/wordpress -type d -exec chmod 775 {} \;
sudo find /bitnami/wordpress -type f -exec chmod 664 {} \;
sudo chmod 640 /bitnami/wordpress/wp-config.php
Every 1.0s: echo -n 'Apache Processes: ' && ps -C apache2 --no-headers | wc -l && free -m                                            ip-10-0-XX-XXX: Fri May  6 12:19:40 2022

Apache Processes: 0
              total        used        free      shared  buff/cache   available
Mem:          15902        1708       13010          88        1184       13777
Swap:             0           0           0

Hi @NFC,

If you increased the number of PHP processes, restarted the services, reset the permissions and have enough RAM memory, please check what’s the error you get now in the Apache’s log file (/opt/bitnami/apache/logs/error_log). You will find useful information there about the application.

You can also try to access the app from inside the VM to check if its response is valid. The 504 error message may be cached in the LoadBalancer.

Can you please tell me how can I do that?

I ran diagnostic again.


Please help me understand what is making the site so slow when there is no virtually no traffic and I am using Large Instance for the website?

You can use curl to access the app

curl -LIk localhost

Did you check the info I posted above?