• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

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