• 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

Issue My website got 499 & 502 + php-fpm.sock failed (11: Resource temporarily unavailable) errors

Hassaan

Basic Pleskian
Hi,

I stuck with this issue browsed too many forums but Issue still not solved.

Sample / Example Error Logs


2017-02-27 14:56:23 Error 162.158.78.50 499 GET / HTTP/1.1 loader.io;1531d7b5baa76395e0c4ff04b9c6a175 0 nginx access
2017-02-27 14:56:23 Error 162.158.78.20 502 GET / HTTP/1.1 loader.io;1531d7b5baa76395e0c4ff04b9c6a175 166 nginx access
2017-02-27 14:56:23 Error 162.158.78.170 502 GET / HTTP/1.1 loader.io;1531d7b5baa76395e0c4ff04b9c6a175 166 nginx access
2017-02-27 14:56:23 Error 162.158.79.63 502 GET / HTTP/1.1 loader.io;1531d7b5baa76395e0c4ff04b9c6a175 166 nginx access
2017-02-27 14:56:23 Error 162.158.78.50 499 GET / HTTP/1.1 loader.io;1531d7b5baa76395e0c4ff04b9c6a175 0 nginx access
2017-02-27 14:56:23 Error 162.158.78.20 499 GET / HTTP/1.1 loader.io;1531d7b5baa76395e0c4ff04b9c6a175 0 nginx access
2017-02-27 14:56:23 Error 162.158.78.20 499 GET / HTTP/1.1 loader.io;1531d7b5baa76395e0c4ff04b9c6a175 0 nginx access
2017-02-27 14:56:23 Error 162.158.78.20 499 GET / HTTP/1.1 loader.io;1531d7b5baa76395e0c4ff04b9c6a175 0 nginx access
2017-02-27 14:56:23 Error 162.158.78.20 499 GET / HTTP/1.1 loader.io;1531d7b5baa76395e0c4ff04b9c6a175 0 nginx access


and After few time I got

2017-02-27 14:56:23 Error 172.68.65.4 24026#0: *2784527 connect() to unix:///var/www/vhosts/system/playsongs.pk/php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream nginx error
2017-02-27 14:56:23 Error 172.68.65.112 24023#0: *2784529 connect() to unix:///var/www/vhosts/system/playsongs.pk/php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream nginx error
2017-02-27 14:56:23 Error 172.68.65.100 24028#0: *2784539 connect() to unix:///var/www/vhosts/system/playsongs.pk/php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream nginx error
2017-02-27 14:56:23 Error 172.68.65.112 24021#0: *2784541 connect() to unix:///var/www/vhosts/system/playsongs.pk/php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream nginx error
2017-02-27 14:56:23 Error 172.68.65.112 24021#0: *2784545 connect() to unix:///var/www/vhosts/system/playsongs.pk/php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream nginx error
2017-02-27 14:56:23 Error 172.68.65.112 24021#0: *2784547 connect() to unix:///var/www/vhosts/system/playsongs.pk/php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream nginx error
2017-02-27 14:56:23 Error 172.68.65.112 24028#0: *2784549 connect() to unix:///var/www/vhosts/system/playsongs.pk/php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream nginx error
2017-02-27 14:56:23 Error 162.158.78.50 24028#0: *2784551 connect() to unix:///var/www/vhosts/system/playsongs.pk/php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream nginx error
2017-02-27 14:56:23 Error 172.68.65.112 24028#0: *2784552 connect() to unix:///var/www/vhosts/system/playsongs.pk/php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream nginx error


My nginx Config /etc/nginx/nginx.conf



user nginx;
worker_processes auto; #some last versions calculate it automatically

worker_rlimit_nofile 99999;

error_log /var/log/nginx/error.log crit;

include /etc/nginx/modules.conf.d/*.conf;

events {

worker_connections 66536;
use epoll;
multi_accept on;
}

http {
include mime.types;
default_type application/octet-stream;

open_file_cache max=2048 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 5;
open_file_cache_errors off;


access_log off;

sendfile on;
tcp_nopush on;
tcp_nodelay on;

keepalive_timeout 2;
keepalive_requests 100000;
reset_timedout_connection on;
client_body_timeout 30;
send_timeout 15;

client_header_timeout 12;
proxy_connect_timeout 60;
proxy_send_timeout 60;
proxy_read_timeout 60;


fastcgi_buffers 8 128k;
fastcgi_buffer_size 256k;

# reduce the data that needs to be sent over network
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types application/x-javascript text/css application/javascript text/javascript text/plain text/xml application/json application/v$
gzip_disable "MSIE [1-6]\.(?!.*SV1)";


server_tokens off;

include /etc/nginx/conf.d/*.conf;
}

# override global parameters e.g. worker_rlimit_nofile
include /etc/nginx/*global_params;



My php-fpm pool setting are following



;[php-fpm-pool-settings]
pm = dynamic
pm.max_children = 5000
pm.start_servers = 50
pm.min_spare_servers = 20
pm.max_spare_servers = 70
pm.max_requests = 2000



Here is information of Server
Plesk Onyx
CENTOS 7.2 64bit
RAM 64GB
 
Last edited:
The "upstream" error says that upstream (meaning Apache) cannot be reached. This is normally the case if fail2ban has blocked either 127.0.0.1 or the public IPv4 address of your host. Make sure that both are entered into fail2ban's whitelist and removed from the blocked IP list.
 
The "upstream" error says that upstream (meaning Apache) cannot be reached. This is normally the case if fail2ban has blocked either 127.0.0.1 or the public IPv4 address of your host. Make sure that both are entered into fail2ban's whitelist and removed from the blocked IP list.
Thank you sir for great response but fail2ban is not installed :(
 
Can you please verify, that the PHP-FPM service of the PHP version that the affected site is using is running?
# service plesk-php56-fpm status
# service plesk-php70-fpm status
# service plesk-php71-fpm status
 
Can you please verify, that the PHP-FPM service of the PHP version that the affected site is using is running?
# service plesk-php56-fpm status
# service plesk-php70-fpm status
# service plesk-php71-fpm status

I'm only using php-fpm 7.0 and status of `service plesk-php70-fpm status` is following


● plesk-php70-fpm.service - The PHP 7.0.16 FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/plesk-php70-fpm.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2017-02-27 15:40:33 PKT; 1 day 22h ago
Main PID: 670 (php-fpm)
Status: "Processes active: 8, idle: 13, Requests: 1721403, slow: 0, Traffic: 493req/sec"
CGroup: /system.slice/plesk-php70-fpm.service
├─ 670 php-fpm: master process (/opt/plesk/php/7.0/etc/php-fpm.conf)
├─ 1405 php-fpm: pool ****.top
├─ 1413 php-fpm: pool *****.top
├─ 1463 php-fpm: pool ****.top
├─ 1466 php-fpm: pool ****.top
├─ 1471 php-fpm: pool ****.top
├─ 4157 php-fpm: pool ****.com
├─ 4468 php-fpm: pool ****.com
├─ 7884 php-fpm: pool *****.top
├─11991 php-fpm: pool *****.site
├─12276 php-fpm: pool *****.site
├─12282 php-fpm: pool ****.site
├─12665 php-fpm: pool ****.site
├─14646 php-fpm: pool ****.site
├─19109 php-fpm: pool ****.com
├─21615 php-fpm: pool ****.top
├─23163 php-fpm: pool ****.com
├─27657 php-fpm: pool *****.top
├─27907 php-fpm: pool playsongs.pk
├─27942 php-fpm: pool playsongs.pk
├─27943 php-fpm: pool playsongs.pk
├─27984 php-fpm: pool playsongs.pk
├─27996 php-fpm: pool playsongs.pk
└─30532 php-fpm: pool ****.com

Feb 27 15:40:27 ns503772.ip-192-9****** systemd[1]: Starting The PHP 7.0.16 FastCGI Process Manager...
Feb 27 15:40:33 ns503772.ip-192-9****** systemd[1]: Started The PHP 7.0.16 FastCGI Process Manager.
 
Last edited:
On one of our servers we have a symptom where PHP-FPM becomes unresponsive although the service status is "active". Have you tried to restart that server?
# service plesk-php70-fpm restart
It could help to make the interface available again to Nginx.
 
On one of our servers we have a symptom where PHP-FPM becomes unresponsive although the service status is "active". Have you tried to restart that server?
# service plesk-php70-fpm restart
It could help to make the interface available again to Nginx.

yes, I done this but issue does not sovled

Latest status of `service plesk-php70-fpm status` is following

● plesk-php70-fpm.service - The PHP 7.0.16 FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/plesk-php70-fpm.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2017-03-01 14:45:11 PKT; 1min 19s ago
Main PID: 13224 (php-fpm)
Status: "Processes active: 10, idle: 12, Requests: 6006, slow: 0, Traffic: 492req/sec"
CGroup: /system.slice/plesk-php70-fpm.service
├─13224 php-fpm: master process (/opt/plesk/php/7.0/etc/php-fpm.conf)
├─13225 php-fpm: pool dailymotionfile.com
├─13227 php-fpm: pool 4songspk.site
├─13229 php-fpm: pool getplay.top
├─13232 php-fpm: pool playhdpk.top
├─13237 php-fpm: pool 4songspk.site
├─13250 php-fpm: pool getplay.top
├─13269 php-fpm: pool 4songspk.site
├─13277 php-fpm: pool playhdpk.top
├─13282 php-fpm: pool dailymotionfile.com
├─13308 php-fpm: pool getplay.top
├─13313 php-fpm: pool getplay.top
├─13317 php-fpm: pool getplay.top
├─13653 php-fpm: pool playhdpk.top
├─13994 php-fpm: pool 4songspk.site
├─14029 php-fpm: pool pakhotline.top
├─14412 php-fpm: pool playsongs.pk
├─14456 php-fpm: pool playsongs.pk
├─14465 php-fpm: pool playsongs.pk
├─14479 php-fpm: pool playsongs.pk
└─14481 php-fpm: pool playsongs.pk

Mar 01 14:45:11 ns503772.ip-192-9****** systemd[1]: Starting The PHP 7.0.16 FastCGI Process Manager...
Mar 01 14:45:11 ns503772.ip-192-9****** systemd[1]: Started The PHP 7.0.16 FastCGI Process Manager.
 
output of #cat /proc/$(cat /run/nginx.pid)/limits is following. May it will be helpful to solve the issue

Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 515124 515124 processes
Max open files 1024 4096 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 515124 515124 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
 
Back
Top