10

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.

Community
  • 1
  • 1
Rahul Patil
  • 1,014
  • 3
  • 14
  • 30
  • 1
    For nginx client is ELB. – Alexey Ten Oct 31 '14 at 10:49
  • 1
    I know it's an old post, but still found by google when searching for `499` nginx: A `499` also happens when a load balancer (LB) is in place or a proxy and the upstream (i.e., the proxy) times out, see for example https://stackoverflow.com/questions/12973304/nginx-499-error-codes/27348833. So it could also be the `nodeJS` that timed out. – Philipp Aug 29 '17 at 22:32

0 Answers0