Repeated Error 522 / Error 524 - A timeout occurred

Keywords: WordPress + NGINX + SSL - AWS - Technical issue - Other
bnsupport ID: 09337a21-9eaa-dc17-f313-8cc456497d04

We are running t3a.medium for this site:

Still, there are many cases where the website repeatedly encounters Error 524 / Error 522 - A timeout occurred. Doesn’t open most of the time.

Things were fine almost the entire year, Recently from the last 2-3 weeks - This is happening a lot.

I also ran sudo tail -40 /opt/bitnami/php/var/log/php-fpm.log,
sudo tail -n 40 /opt/bitnami/php/var/log/php-fpm.log & also
sudo tail -40 /opt/bitnami/php/logs/php-fpm.log

But no response received:

Could you please check?

Hello again @vgnavada!

Your timeout errors could be coming from a insufficient memory error:

 2021/06/21 08:16:59 [error] 1129#0: *166770 FastCGI sent in stderr: "PHP message: PHP Fatal error: Out of memory (allocated 25165824) (tried to allocate 40960 bytes) in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/td-composer/legacy/common/wp_booster/td_util.php on line 2934PHP message: PHP Fatal error: Out of memory (allocated 25165824) (tried to allocate 65536 bytes) in /opt/bitnami/apps/wordpress/htdocs/wp-includes/class-wp-hook.php on line 292" while reading response header from upstream, client: **ip_address**, server: localhost, request: "GET /news/unlock-4/ HTTP/1.1", upstream: "fastcgi://unix:/opt/bitnami/php/var/run/www.sock:", host: ""

You shouldn’t have any memory issues with your instance size so it may be necessary to update your memory limits in your PHP and/or php-fpm configuration as explained in our Configure PHP-FPM Options guide.

Also, you are close to your maximum disk space, you may want to increase your disk size soon:
Your disk is almost full: You could try to increase your instance’s storage.

Check free amount of disk space
Running: df -h
In: /opt/bitnami


Filesystem       Size  Used Avail Use% Mounted on
udev             3.9G     0  3.9G   0% /dev
tmpfs            791M  8.4M  782M   2% /run
/dev/nvme0n1p1   9.7G  8.3G  949M  90% /
tmpfs            3.9G     0  3.9G   0% /dev/shm
tmpfs            5.0M     0  5.0M   0% /run/lock
tmpfs            3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/nvme0n1p15  124M  278K  124M   1% /boot/efi
tmpfs            791M     0  791M   0% /run/user/1000

Francisco de Paz

Hello @fdepaz,

  1. I have increased the EBS volume by + 5GB and the present volume size is 15 GB now :slight_smile: image

  2. Configure PHP-FPM Options - As per this documentation, I checked the memory_limit - It is set to 512 MB.
    Do you think this is sufficient? If I’m to increase it, What should be the optimum value for it? Could you please guide me?

  3. And the test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation." command says we have a SELF-CONTAINED INSTALLATION:
    But i could not find the php-settings.conf file in the mentioned path: /opt/bitnami/apps/wordpress/conf/php-fpm/php-settings.conf
    I only got these:

    Which file do I edit?

Awaiting your response!

Hello @vgnavada,

Given your available memory of 8GB, you can try increasing to 2048M or 4096M you keep encountering out-of-memory issues.

Regarding the change to the php-fpm pool configuration, our documentation is outdated and the paths have changed. You just need to add the configuration option php_value[memory_limit]=2048M in the pool configuration file you are using as we discussed in a previous thread.

Francisco de Paz

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.