ERR_TIMED_OUT - Error establishing database connection

Keywords: WordPress - AWS - Technical issue - Other
Description:
Beginner Here.

My site gets “err_timed_out” at least 2 times a day.

on the error_log , I’m getting -

[Tue Apr 06 07:34:11.891865 2021] [pagespeed:error] [pi
d 1100:tid 140178672842496] [mod_pagespeed 1.13.35.2-0
@1100] Slow ReadFile operation on file /opt/bitnami/apa
che2/var/cache/mod_pagespeed/v3/thepopupshopla.com/http
s,3A/,2Fwww.thepopupshopla.com/wp-content/uploads/2021/
03/desertstorm7.webp,: 66.736ms; configure SlowFileLate
ncyUs to change threshold\n

tried using the bnsupport-tool and got this message:
"The support bundle file was successfully created, but the automatic upload to Bitnami servers failed. You will ne
ed to upload it to your Bitnami Support ticket manually. Please locate the following file in your file browser or
in your terminal: /tmp/bitnami-wordpress-info-20210406-075316-1914.zip Exercise caution when uploading the resul
ting support bundle to public sites as it contains detailed diagnostic information.bitnami@ip-172-26-13-51:~$ "

Please help! thank you

Hello @vafaifreddy,

We have a Support Tool that will gather relevant information for us to analyze your configuration and logs. Could you please execute it on the machine where the stack is running by following the steps described in the guide below?

Please note that you need to paste the code ID that is shown at the end.

Thank you !
just sent a message with the manual upload!

Hello @vafaifreddy,

I was checking the support output and it is almost empty. It is usually due to a lack of memory or storage. Could you please execute the following commands and share the output with us?

cd /opt/bitnami
free -m
df -h
df -ih

Regards

sure!

          total        used        free      shared

buff/cache available
Mem: 482 378 5 35
98 55
Swap: 634 12 622

Filesystem Size Used Avail Use% Mounted on
udev 233M 0 233M 0% /dev
tmpfs 49M 1.6M 47M 4% /run
/dev/xvda1 20G 5.1G 14G 28% /
tmpfs 242M 0 242M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 242M 0 242M 0% /sys/fs/cgroup
/dev/xvda15 124M 278K 124M 1% /boot/efi
tmpfs 49M 0 49M 0% /run/user/1000

Filesystem Inodes IUsed IFree IUse% Mounted on
udev 59K 275 58K 1% /dev
tmpfs 61K 361 60K 1% /run
/dev/xvda1 1.3M 94K 1.2M 8% /
tmpfs 61K 1 61K 1% /dev/shm
tmpfs 61K 2 61K 1% /run/lock
tmpfs 61K 17 61K 1% /sys/fs/cgroup
/dev/xvda15 0 0 0 - /boot/efi
tmpfs 61K 4 61K 1% /run/user/1000

the site is now going down consistently.

Hi @vafaifreddy,

It seems the instance is using a lot of swap. Note that WordPress requires at least 700M.

You could try to increase your machine type if you face performance issues. This guide explains the process
https://docs.bitnami.com/aws/faq/administration/change-server-type/

Let me share with you our troubleshooting documentation:
https://docs.bitnami.com/aws/how-to/troubleshoot-wordpress-issues/
https://docs.bitnami.com/aws/faq/troubleshooting/troubleshoot-server-performance/

We also have a guide to optimize Wordpress:
https://docs.bitnami.com/aws/apps/wordpress/troubleshooting/optimize-bitnami-wordpress/

I upgraded my instance and it seems to be working ,

thank you !