4

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/*;
}
4
  • The problem isn't in nginx, it is in the jruby on rails service. You need to look into its logs so you see what makes it unresponsive, and then fix those issues. Mar 12, 2016 at 17:01
  • @TeroKilkanen God... Thank you! It was Out Of Memory Error in JVM.. Thanks man, you're genius.
    – mjkim
    Mar 13, 2016 at 1:07
  • @TeroKilkanen i have similar problem, how do i check that?
    – Julien
    Aug 3, 2022 at 0:19
  • I don't know where that service's log are. It is your responsibility as app user to know where the logs are. Aug 3, 2022 at 18:14

0

You must log in to answer this question.

Browse other questions tagged .