On 15.04.2010 13:22, Philip Wigg wrote:

I'm using mod_jk 2.2.27 to connect via AJP to a JBoss backend. The
problem is that a reporting application takes a couple of minutes to
run a report but mod_jk seems to be closing the connection to the
back-end and the user receives a 502 Bad Gateway error. 10 seconds
after the request is made, I see the following in the mod_jk logs.:-

[Thu Apr 01 11:51:45.586 2010] [10148:1178638688] [debug]
jk_shutdown_socket::jk_connect.c (680): About to shutdown socket 13
[Thu Apr 01 11:51:45.726 2010] [10148:1084229984] [debug]
jk_watchdog_func::mod_jk.c (2850): Watchdog thread running
[Thu Apr 01 11:51:47.586 2010] [10148:1178638688] [debug]
jk_shutdown_socket::jk_connect.c (731): Shutdown socket 13 and read 0
lingering bytes
[Thu Apr 01 11:51:47.586 2010] [10148:1178638688] [info]
ajp_connection_tcp_get_message::jk_ajp_common.c (1111): (tomcat1)
can't receive the response message from tomcat, network problems or
tomcat ( is down (errno=11)
[Thu Apr 01 11:51:47.586 2010] [10148:1178638688] [error]
ajp_get_reply::jk_ajp_common.c (1920): (tomcat1) Tomcat is down or
refused connection. No response has been sent to the client (yet)
[Thu Apr 01 11:51:47.586 2010] [10148:1178638688] [info]
ajp_service::jk_ajp_common.c (2407): (tomcat1) sending request to
tomcat failed (recoverable),  (attempt=1)
[Thu Apr 01 11:51:47.586 2010] [10148:1178638688] [debug]
ajp_service::jk_ajp_common.c (2267): retry 1, sleeping for 100 ms
before retrying

The worker.properties file has only the following timeouts configured:-


Which timeout is likely to be responsible for closing this connection?

The socket timeout.

I have run a network trace between the web and app servers and it
shows there's no AJP traffic at all between them whilst the report is
being generated and then the connection being closed after 10 seconds,
would socket_timeout close the connection in that case? I don't see
any errors about failing cping/cpongs.

Recent versions of mod_jk allow a very fine-grained response timeout configuration, so that you can e.g. set a general response timeout to 20 seconds and a longer timeout like 60 seconds for special URLs you expect to take longer like report generation.

The cases where you would need short timeouts are the cping/cpong and during connection setup. For the latter there is now also a special timeout, so that you can actually drop the socket timeout.

Have a look at:


which tries to describe the possible timepouts and their implications in great length.



To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to