• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue All websites 502 gateway error NGINX

James Lewis

New Pleskian
Hey,

I recently migrated from OVH to Digital Ocean setup my websites like I did on my previous server and used the migrator tool.

Recently NGINX keeps going down for all websites at random times and all websites have a 502 error I found this error in the logs

1146#0: *17200 connect() to unix:///var/www/vhosts/system/hallandrandallplumbers.com/php-fpm.sock failed (111: Connection refused) while connecting to upstream

It does this until I restart the server, I am unsure what is causing the issue and really need some support on this, please let me know if you need any further details to help me?
 
Make sure that Fail2Ban has two addresses whitelisted at least:
- the server's own IP address
- the 127.0.0.1 IP address
 
Make sure that Fail2Ban has two addresses whitelisted at least:
- the server's own IP address
- the 127.0.0.1 IP address

Hi I have already done this but still get the error after a few hours of the sites being live, see image attached.
 

Attachments

  • Screenshot 2019-01-16 at 12.58.24.png
    Screenshot 2019-01-16 at 12.58.24.png
    72.6 KB · Views: 8
This needs a test: Next time, this occurs, do not restart the server, but restart the PHP FPM service of the PHP version you are using, for example:

# service plesk-php56-fpm restart
or
# service plesk-php71-fpm restart
...

Then test again, if the sites are up again and report here. It could be that the maximum number of PHP children is exceeded so that no further PHP instances can be created. This will lead to unavailability of PHP FPM as shown in your first post.
 
This needs a test: Next time, this occurs, do not restart the server, but restart the PHP FPM service of the PHP version you are using, for example:

# service plesk-php56-fpm restart
or
# service plesk-php71-fpm restart
...

Then test again, if the sites are up again and report here. It could be that the maximum number of PHP children is exceeded so that no further PHP instances can be created. This will lead to unavailability of PHP FPM as shown in your first post.

Well to fix it before I have just set the PHP settings to down a version then back up a version which put the website back live?
 
You should also look into the PHP-FPM error logs, e.g.
/var/log/plesk-php70-fpm/error.log
for further information. And definitely search them for the "children" keyword, like
# grep children /var/log/plesk-php56-fpm/error.log
# grep children /var/log/plesk-php70-fpm/error.log
# grep children /var/log/plesk-php71-fpm/error.log
# grep children /var/log/plesk-php72-fpm/error.log
Chances are that there will be entries.
 
You should also look into the PHP-FPM error logs, e.g.
/var/log/plesk-php70-fpm/error.log
for further information. And definitely search them for the "children" keyword, like
# grep children /var/log/plesk-php56-fpm/error.log
# grep children /var/log/plesk-php70-fpm/error.log
# grep children /var/log/plesk-php71-fpm/error.log
# grep children /var/log/plesk-php72-fpm/error.log
Chances are that there will be entries.

Hi seems to be getting errors yes please see below

[13-Jan-2019 15:26:18] WARNING: [pool chrissfishandchipsworthing.co.uk] server reached max_children setting (5), consider raising it
[13-Jan-2019 15:40:10] WARNING: [pool chrissfishandchipsworthing.co.uk] server reached max_children setting (5), consider raising it
[13-Jan-2019 15:55:26] WARNING: [pool hallandrandallplumbers.com] server reached max_children setting (5), consider raising it
[14-Jan-2019 08:21:37] WARNING: [pool vaportech.co.uk] server reached max_children setting (5), consider raising it
[15-Jan-2019 08:41:24] WARNING: [pool chrissfishandchipsworthing.co.uk] server reached max_children setting (5), consider raising it
[15-Jan-2019 08:45:14] WARNING: [pool chrissfishandchipsworthing.co.uk] server reached max_children setting (5), consider raising it
[15-Jan-2019 08:46:55] WARNING: [pool chrissfishandchipsworthing.co.uk] server reached max_children setting (5), consider raising it
[15-Jan-2019 10:00:31] WARNING: [pool chrissfishandchipsworthing.co.uk] server reached max_children setting (5), consider raising it
 
Your subscription > PHP > PHP-FPM Settings
pm.max_children: Change to 25
pm.max_requests: Change to 10000
pm: ondemand

Save new configuration. This needs to be done in each of your domains.

plesk.jpg
 
Back
Top