Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unicorn nginx upstream server not starting

My unicorn server was running fine, but has stopped working and I can't figure out how to get it restarted.

2011/04/18 15:23:42 [error] 11907#0: *4 connect() to unix:/tmp/sockets/unicorn.sock failed (111: Connection refused) while connecting to upstream, client: 71.131.237.122, server: localhost, request: "GET / HTTP/1.1", upstream: "http://unix:/tmp/sockets/unicorn.sock:/", host: "tacitus"

my config files are at: https://gist.github.com/926006

any help as to what my troubleshooting options should be would be greatly appreciated.

best,

Tim

like image 831
bonhoffer Avatar asked Apr 18 '11 19:04

bonhoffer


1 Answers

I had similar issue with nginx and unicorn setup.

Every day I've seen in nginx error.log this error:

failed (11: Resource temporarily unavailable) while connecting to upstream

The way I fixed it was to change unix socket to tcp socket.

so instead

upstream unicorn_app {
  server unix:/tmp/sockets/unicorn.sock fail_timeout=0;
}

now I'm using

upstream unicorn_app {
  server 127.0.0.1:3000 fail_timeout=0;
}

Hope it will help someone.

like image 102
sparrovv Avatar answered Oct 05 '22 08:10

sparrovv