My Setup :
Curl --> AWS ELB --> Nginx --> NodeJS
When number of request High then I face this issue.
Nginx access logs
xx.xx.xx.xx - - [30/Oct/2014:13:23:40 +0000] "POST /some/calls/object HTTP/1.1" 499 0 "-" "curl/7.27.0"
xx.xx.xx.xx - - [30/Oct/2014:13:23:40 +0000] "POST /some/calls/object HTTP/1.1" 499 0 "-" "curl/7.27.0"
Nginx error logs
2014/10/30 13:23:40 [info] 11181#0: *17811 client xx.xx.xx.xx closed keepalive connection
2014/10/30 13:23:40 [info] 11181#0: *17631 epoll_wait() reported that client prematurely closed connection, so upstream connection is closed too while sending request to upstream, client: xx.xx.xx.xx, server: example.com, request: "POST /some/calls/objects HTTP/1.1", upstream: "http://xx.xx.xx.xx:xx/some/calls/object", host: "example.com"
NodeJS logs
2014-10-30T13:23:40.074Z : info : req.method GET
2014-10-30T13:23:40.074Z : info : req.url /some/calls/objects
2014-10-30T13:23:40.074Z : info : error { message: 'Request Timed Out!' }
2014-10-30T13:23:40.075Z : info : req.method GET
2014-10-30T13:23:40.075Z : info : req.url /some/calls/objects
2014-10-30T13:23:40.075Z : info : error { message: 'Request Timed Out!' }
2014-10-30T13:23:40.075Z : info : error.stack undefined
2014-10-30T13:23:40.076Z : info : error.stack undefined
Question
as per this link 499 means client closed the connection, but my question is, who is the client in this scenario, is ELB closing the connection or curl or nodejs ?
I've also observed that nodejs takes 60+ seconds to respond calls, if nodejs encounter Timed out issue, then it keep occurring again and again.