title: Nginx + unicorn (rails) often gives "Connection refused" in nginx error log
body: <p>At work we're running some high traffic sites in rails. We often get a problem with the following being spammed in the nginx error log:</p>
  
  <pre><code>2011/05/24 11:20:08 [error] 90248#0: *468577825 connect() to unix:/app_path/production/shared/system/unicorn.sock failed (61: Connection refused) while connecting to upstream
  </code></pre>
  
  <p>Our setup is nginx on the frontend server (load balancing), and unicorn on our 4 app servers. Each unicorn is running with 8 workers. The setup is very similar to the one GitHub uses.</p>
  
  <p>Most of our content is cached, and when the request hits nginx it looks for the page in memcached and serves that it if can find it - otherwise the request goes to rails. </p>
  
  <p>I can solve the above issue - SOMETIMES - by doing a pkill of the unicorn processes on the servers followed by a:</p>
  
  <pre><code>cap production unicorn:check (removing all the pid's)
  cap production unicorn:start
  </code></pre>
  
  <p>Do you guys have any clue to how I can debug this issue? We don't have any significantly high load on our database server when these problems occurs..</p>