You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mott Leroy <mo...@acadaca.com> on 2005/11/29 20:25:27 UTC

mod_jk setting caused occassional 503 apache errors

I recently added some settings to my worker.properties which caused
apache to throw occassional "503" ("Service Temporarily Unavailable")
errors. I've commented out the setting and the errors do not occur.

The settings are related to timeouts (connect_timeout, prepost_timeout, 
and reply_timeout) placed on two load balanced workers. If a timeout 
occurs, it's supposed to failover to the other node. (note that one node 
is disabled, so it's fault tolerant, not truly load balanced)

The simple answer may be just to increase the timeout, but even so, it 
should be failing over, not timing out and throwing a 503 error. I've 
listed below my environment, a snippet of my worker.properties file, 
and the errors i saw in my mod_jk log. Any help and/or suggestions would 
be much appeciated! Thanks.

Mott

---- begin environment snippet ---
jre 1.4.2
tomcat 5.0.28
redhat linux fedora core 2
mod_jk 1.2.14.1
---- end environment snippet ---

------------- begin worker.properties snippet ----------
worker.list=lb_builds,jkstatus

# macros for timeouts
default.connect_timeout=3000
default.prepost_timeout=3000
default.reply_timeout=8000

worker.lb_builds.type=lb
worker.lb_builds.balance_workers=lb_tala_build,lb_bj_build
worker.lb_builds.sticky_session=true
# if the server is down, don't force the session - failover to the other 
server
worker.lb_builds.sticky_session_force=false

# lb - tala: build
worker.lb_tala_build.type=ajp13
worker.lb_tala_build.host=tala
worker.lb_tala_build.port=8000
worker.lb_tala_build.lbfactor=1
worker.lb_tala_build.socket_keepalive=1
worker.lb_tala_build.recycle_timeout=300
worker.lb_tala_build.redirect=lb_bj_build
# one of these now commented out properties caused the errors
# worker.lb_tala_build.connect_timeout=$(default.connect_timeout)
# worker.lb_tala_build.prepost_timeout=$(default.prepost_timeout)
# worker.lb_tala_build.reply_timeout=$(default.reply_timeout)

# lb - bj: build
worker.lb_bj_build.type=ajp13
worker.lb_bj_build.host=bj
worker.lb_bj_build.port=8000
worker.lb_bj_build.lbfactor=1
worker.lb_bj_build.socket_keepalive=1
worker.lb_bj_build.recycle_timeout=300
worker.lb_bj_build.disabled=True
# one of these now commented out properties caused the errors
# worker.lb_bj_build.connect_timeout=$(default.connect_timeout)
# worker.lb_bj_build.prepost_timeout=$(default.prepost_timeout)
# worker.lb_bj_build.reply_timeout=$(default.reply_timeout)

# load balancing status worker
worker.jkstatus.type=status
------------- end worker.properties snippet ----------


------------------ snip begin mod_jk log ------
[Mon Nov 28 09:33:38 2005] [info]  ajp_service::jk_ajp_common.c (1749): 
Sending request to tomcat failed,  recoverable operation attempt=1
[Mon Nov 28 09:43:40 2005] [iror] ajp_get_reply::jk_ajp_common.c (1483): 
Timeout with waiting reply from tomcat. Tomcat is down, stopped or 
network problems.
[Mon Nov 28 09:26:40 2005] [info]  ajp_service::jk_ajp_common.c (1721): 
Receiving from tomcat failed, recoverable operation attempt=1
[Mon Nov 28 09:26:40 2005] [info]  ajp_service::jk_ajp_common.c (1749): 
Sending request to tomcat failed,  recoverable operation attempt=2
[Mon Nov 28 09:26:48 2005] [error] ajp_get_reply::jk_ajp_common.c 
(1483): Timeout with waiting reply from tomcat. Tomcat is down, stopped 
or network problems.
[Mon Nov 28 09:26:48 2005] [info]  ajp_service::jk_ajp_common.c (1721): 
Receiving from tomcat failed, recoverable operation attempt=2
[Mon Nov 28 09:26:48 2005] [info]  ajp_service::jk_ajp_common.c (1749): 
Sending request to tomcat failed,  recoverable operation attempt=3
[Mon Nov 28 09:26:48 2005] [error] ajp_service::jk_ajp_common.c (1758): 
Error connecting to tomcat. Tomcat is probably not started or is 
listening on the wrong port. worker=lb_tala_build failed
[Mon Nov 28 09:26:48 2005] [info]  service::jk_lb_worker.c (662): 
service failed, worker lb_tala_build is in error state
[Mon Nov 28 09:26:48 2005] [error] service::jk_lb_worker.c (703): All 
tomcat instances failed, no more workers left
[Mon Nov 28 09:26:48 2005] [info]  jk_handler::mod_jk.c (1844): Service 
error=0 for worker=lb_builds
------------------ snip end mod_jk log ------

Note that I also regularly see the following snippet in my mod_jk logs, 
but doesn't seem to be causing any harm:

[Tue Nov 29 13:41:32 2005] [info]  ajp_send_request::jk_ajp_common.c 
(1178): Socket 10 is not connected any more (errno=-1)
[Tue Nov 29 13:41:32 2005] [info]  ajp_send_request::jk_ajp_common.c 
(1202): Error sending request. Will try another pooled connection
[Tue Nov 29 13:41:32 2005] [info]  ajp_send_request::jk_ajp_common.c 
(1225): All endpoints are disconnected or dead
[Tue Nov 29 13:41:32 2005] [info]  ajp_service::jk_ajp_common.c (1749): 
Sending request to tomcat failed,  recoverable operation attempt=1


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