nat - body_bytes_sent in nginx access log with read timed out -


i facing read timed out exception api server occurs once or twice day.

i investigated nginx access log , tomcat log , found pattern. when read timed out exception occurs, '$body_bytes_sent' in nginx access log 201. know, size of '$body_bytes_sent' variable depends on response data.

'$body_bytes_sent' is:

number of bytes sent client, not counting response header; variable compatible “%b” parameter of mod_log_config apache module

i think body related read timed out when $body_bytes_sent 201. however, have no idea sends read timed out data. using closeablehttpclient , read timed out 20 sec , host send response in 2 sec.

the route of request host tomcat -> nginx -> nat -> host. nat send read timed out data because host send response before read timed out occured?

also, tomcat log is:

[2017-09-05 17:00:25] [debug] o.a.h.i.c.loggingmanagedhttpclientconnection.onrequestsubmitted[135] http-outgoing-1096 >> post /test/cancel http/1.1 [2017-09-05 17:00:25] [debug] o.a.h.i.c.loggingmanagedhttpclientconnection.onrequestsubmitted[138] http-outgoing-1096 >> connection: close [2017-09-05 17:00:25] [debug] o.a.h.i.c.loggingmanagedhttpclientconnection.onrequestsubmitted[138] http-outgoing-1096 >> transfer-encoding: chunked [2017-09-05 17:00:25] [debug] o.a.h.i.c.loggingmanagedhttpclientconnection.onrequestsubmitted[138] http-outgoing-1096 >> content-type: application/json; charset=utf-8 [2017-09-05 17:00:25] [debug] o.a.h.i.c.loggingmanagedhttpclientconnection.onrequestsubmitted[138] http-outgoing-1096 >> content-encoding: utf-8 [2017-09-05 17:00:25] [debug] o.a.h.i.c.loggingmanagedhttpclientconnection.onrequestsubmitted[138] http-outgoing-1096 >> host: api-test.test.com [2017-09-05 17:00:25] [debug] o.a.h.i.c.loggingmanagedhttpclientconnection.onrequestsubmitted[138] http-outgoing-1096 >> user-agent: apache-httpclient/4.5.2 (java/1.8.0_121) [2017-09-05 17:00:25] [debug] o.a.h.i.c.loggingmanagedhttpclientconnection.onrequestsubmitted[138] http-outgoing-1096 >> accept-encoding: gzip,deflate  [2017-09-05 17:00:45] [debug] o.a.h.i.c.wire.wire[86] http-outgoing-1096 << "[read] i/o error: read timed out" [2017-09-05 17:00:45] [debug] o.a.h.i.c.loggingmanagedhttpclientconnection.close[81] http-outgoing-1096: close connection [2017-09-05 17:00:45] [debug] o.a.h.i.c.loggingmanagedhttpclientconnection.shutdown[98] http-outgoing-1096: shutdown connection [2017-09-05 17:00:45] [debug] o.a.h.i.e.connectionholder.abortconnection[128] connection discarded [2017-09-05 17:00:45] [debug] o.a.h.i.c.poolinghttpclientconnectionmanager.releaseconnection[320] connection released: [id: 1096][route: {s}->https://api-test.test.com:443][total kept alive: 0; route allocated: 0 of 60; total allocated: 0 of 70] [2017-09-05 17:00:45] [debug] o.a.h.i.c.poolinghttpclientconnectionmanager.shutdown[388] connection manager shutting down [2017-09-05 17:00:45] [debug] o.a.h.i.c.poolinghttpclientconnectionmanager.shutdown[394] connection manager shut down 


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -