I have ran jruby on rails in AWS ubuntu trusty 14.04 configuration. my server was going well during several hours. but suddenly get socket connect failed error.
-nginx error.log
2016/03/12 10:12:10 [error] 28444#0: *256477 connect() to unix:/home/deploy/shared/tmp/sockets/puma.sock failed (11: Resource temporarily unavailable) while connecting to upstream, ...
2016/03/12 10:12:11 [error] 28444#0: *256500 connect() to unix:/home/deploy/shared/tmp/sockets/puma.sock failed (111: Connection refused) while connecting to upstream, ...
2016/03/12 10:12:17 [crit] 28444#0: *256512 connect() to unix:/home/deploy/shared/tmp/sockets/puma.sock failed (2: No such file or directory) while connecting to upstream, ...
first, 11: Resource temporarily unavailable error appeared then, 111: Connection refused error, and finally, 2: No such file or directory error keep appearing.
I searched the problem and get this answer. -> Need to increase nginx throughput to an upstream unix socket -- linux kernel tuning?
so, I edited /etc/sysctl.conf
net.core.somaxconn = 1024
net.core.netdev_max_backlog = 1000
but the problem not solved.. still getting fxxking errors..
when I get connection failed errors, I restart puma server. then the server do its jobs well.
what's the problem? I can't keep restarting all day. help me, please.
nginx.conf
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 1536;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}