I had a similar issue in the past with a Laravel application and I was able to fix it by reducing the workload on pulling info from the DB.
But this time is a WordPress application hosted on Ubuntu 20.04 (LTS) x64 1 vCPUs 1GB / 25GB Disk I get this 504 Bad Gateway error 3-4 times daily and each time this error occurs, the site is down for about 5-10 minutes.
Here is the output from free -m
total used free shared buff/cache available
Mem: 981 741 69 80 169 40
Swap: 0 0 0
And the output I get from mpstat
Linux 5.4.0-51-generic (ubuntu-s-1vcpu-1gb-nyc1-01) 02/05/21 _x86_64_ (1 CPU)
21:59:40 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
21:59:40 all 3.59 0.02 1.17 0.63 0.00 0.06 0.02 0.00 0.00 94.52
And lastly the output from iostat 1
avg-cpu: %user %nice %system %iowait %steal %idle
0.00 0.00 0.00 0.00 0.00 100.00
Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd
loop0 0.00 0.00 0.00 0.00 0 0 0
loop1 0.00 0.00 0.00 0.00 0 0 0
loop2 0.00 0.00 0.00 0.00 0 0 0
loop3 0.00 0.00 0.00 0.00 0 0 0
loop4 0.00 0.00 0.00 0.00 0 0 0
loop5 0.00 0.00 0.00 0.00 0 0 0
loop6 0.00 0.00 0.00 0.00 0 0 0
loop7 0.00 0.00 0.00 0.00 0 0 0
vda 1.00 0.00 4.00 0.00 0 4 0
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello, @supportAnemone
The issue is most likely related with the PHP-FPM service. The first thing I’d recommend, before we get started with the configuration, would be to tail the logs.
tail -n 50 /var/log/nginx/error.log
Also, let’s take a look at the PHP-FPM log, which should be in /var/log as well.
tail -n 50 /var/log/php$-fpm.log
Keep in mind that you need to select the fpm log for the PHP version in use.
You can also share the content of the php-fpm pool config file so we can check if we need to increase any of the settings like the pm.max_children because the issue is most probably related with the fact that the server have reached the pm.max_children limit.
Regards, Alex
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.