502 bad gateway on nginx with recv() failed
nareshov at gmail.com
Fri Oct 22 15:50:19 EDT 2010
I'm serving the puppetmaster application with its config.ru through
unicorn - proxied by nginx.
I'm using unix sockets, 4 workers, and 2048 backlog.
The clients - after their typical "puppet run" - send back a report to
the master in YAML.
Some clients whose reports tend to be large (close to 2mb) get a 502
bad gateway error and error out.
2010/10/22 14:20:27 [error] 19461#0: *17115 recv() failed (104:
Connection reset by peer) while reading response header from upstream,
client: 1x.yy.zz.x4, server: , request: "PUT /production/report/nagios
I was getting the same thing earlier when I had unicorn listening on
TCP sockets instead of UNIX sockets. And I had a lot of connections in
tcp 0 0 127.0.0.1:8141 127.0.0.1:54507
tcp 0 0 127.0.0.1:8141 127.0.0.1:57322
Fluctuating all the way from 20 to 800. A quick restart of nginx
tended to bring the number down.
More information about the mongrel-unicorn