3

Newbie to Nginx and Tomcat setup. Can someone help me understand what this error message means.

2014/09/21 00:10:03 [error] 293#0: *127 upstream timed out (60: Operation timed out) while reading response header from upstream, client: 192.168.10.211, server: my.server.com, request: "POST /path/dosomething.json HTTP/1.1", upstream: "http://192.168.10.11:7070/path/dosomething.json";, host: "my.server.com"

When debug mode is turned ON on nginx.

2014/09/21 13:19:54 [error] 303#0: *37 upstream timed out (60: Operation timed out) while reading response header from upstream, client: --- same as above ---

7070 is Tomcat. I noticed this works for the first query after tomcat has been rebooted. But the next query after that gives the above error message. nginx and Tomcat are on same box.

Can someone walk me through, what this error message means and how can this be resolved.

Thanks

java_dude
  • 133
  • 1
  • 2
  • 6

1 Answers1

4

This means that after requesting http://192.168.10.11:7070/path/dosomething.json nginx hanged reading for proxy_read_timeout seconds on the socket used to communicate with your tomcat server and didn't receive any data. Investigate on tomcat's side to understand why it doesn't respond in time.

Xavier Lucas
  • 13,095
  • 2
  • 44
  • 50
  • Thank for your response. I will look at the log statements from tomcat. But how come it worked the first time after tomcat rebooted and then it stopped working. It should fail consistently. – java_dude Sep 21 '14 at 21:30
  • @java_dude Depends on your setup and what your application is doing. Maybe the first request caused full GCs, maybe your are connecting to a database not responding or overloaded, maybe your tomcat has not enough threads etc. It can have many reasons, but I don't have these details so I can only vaguely give these pointers. – Xavier Lucas Sep 21 '14 at 21:33
  • Well thanks for pointing me towards the right direction. Appreciate your help. The problem was to do with connection using Apache HTTPClient. – java_dude Sep 29 '14 at 08:16