You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by he...@kpn.com on 2006/05/24 15:08:09 UTC

Does connectionTimeout > 0 cause failed requests with mod_jk?

Hi,

We are experimenting with the connectTimeout setting on the tomcat side in server.xml. We used to have this set to 0 (inifinite), but we were seeing lot of unused threads and connections on the tomcat side. Thus we set the connectionTimeout to 200000 (200 sec.). After enabling this I observe in the mod_jk logging the following lines:

[Wed May 24 14:46:28 2006] [info]  ajp_send_request::jk_ajp_common.c (1178): Socket 78 is not connected any more (errno=-1)
[Wed May 24 14:46:28 2006] [info]  ajp_send_request::jk_ajp_common.c (1202): Error sending request. Will try another pooled connection
[Wed May 24 14:46:28 2006] [info]  ajp_send_request::jk_ajp_common.c (1225): All endpoints are disconnected or dead
[Wed May 24 14:46:28 2006] [info]  ajp_service::jk_ajp_common.c (1749): Sending request to tomcat failed,  recoverable operation attempt=1
[Wed May 24 14:46:28 2006] [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=worker2 failed
[Wed May 24 14:46:28 2006] [info]  service::jk_lb_worker.c (696): service failed, worker worker2 is in error state

My question is: Do endusers experience any requests which are failing. 

When looking at the mod_jk requestlogging within a few seconds of these error messages, I only see 200 and 302 resultcodes. When looking at the jkstatus page I do not see that the worker2 enters the error state.

Configuration:
Webserver: Apache 2.0.58 on Solaris 8 with worker MPM, with ThreadsPerChild sets to 75

worker.properties for mod_jk 1.2.15:
	worker.worker2.type=ajp13
	worker.worker2.host=192.168.0.3
	worker.worker2.port=1234
	worker.worker2.lbfactor=50
	worker.worker2.cache_timeout=600
	worker.worker2.recycle_timeout=600
	worker.worker2.socket_timeout=62
	worker.worker2.sticky_session=1
	worker.worker2.prepost_timeout=30000
	worker.worker2.recovery_options=0
	worker.worker2.reply_timeout=600000
	worker.worker2.retries=1

	worker.lbworker.type=lb
	worker.lbworker.balance_workers=worker4,worker3,worker2,worker1
	worker.lbworker.sticky_session=1
	worker.lbworker.local_worker_only=0
	worker.lbworker.retries=1

Tomcat 5.0.28:
    <Connector className="org.apache.coyote.tomcat5.CoyoteConnector"
               port="1234"  minProcessors="5" maxProcessors="750"
               acceptCount="10" debug="0" enableLookups="true" redirectPort="8443"
                connectionTimeout="200000" useURIValidationHack="false"
                protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" />

regards Henk Fictorie
-- 
Henk Fictorie 
KPN.com
phone: +31 70 3438362 
mobile: +31 6 51379479
email: henk.fictorie@kpn.com 



Re: Does connectionTimeout > 0 cause failed requests with mod_jk?

Posted by Bill Barker <wb...@wilshire.com>.
Yes, it does cause the error in the logs, for the simple reason that Tomcat 
closed it's side of the Socket once the connectionTimeout was reached.  This 
causes mod_jk to error when it tries to reuse the half-closed socket.

Normally, the error is harmless, since mod_jk just  reopens a new Socket 
connection and continues on (with the user never being any the wiser :).  If 
you set the socket_timeout=200 property on the worker, you'll get nicer 
looking messages in your jk_log.

<he...@kpn.com> wrote in message 
news:DB1C3F5CD74B3F44869497DD597306700A715C@KKWNLEX232.kpnnl.local...
Hi,

We are experimenting with the connectTimeout setting on the tomcat side in 
server.xml. We used to have this set to 0 (inifinite), but we were seeing 
lot of unused threads and connections on the tomcat side. Thus we set the 
connectionTimeout to 200000 (200 sec.). After enabling this I observe in the 
mod_jk logging the following lines:

[Wed May 24 14:46:28 2006] [info]  ajp_send_request::jk_ajp_common.c (1178): 
Socket 78 is not connected any more (errno=-1)
[Wed May 24 14:46:28 2006] [info]  ajp_send_request::jk_ajp_common.c (1202): 
Error sending request. Will try another pooled connection
[Wed May 24 14:46:28 2006] [info]  ajp_send_request::jk_ajp_common.c (1225): 
All endpoints are disconnected or dead
[Wed May 24 14:46:28 2006] [info]  ajp_service::jk_ajp_common.c (1749): 
Sending request to tomcat failed,  recoverable operation attempt=1
[Wed May 24 14:46:28 2006] [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=worker2 failed
[Wed May 24 14:46:28 2006] [info]  service::jk_lb_worker.c (696): service 
failed, worker worker2 is in error state

My question is: Do endusers experience any requests which are failing.

When looking at the mod_jk requestlogging within a few seconds of these 
error messages, I only see 200 and 302 resultcodes. When looking at the 
jkstatus page I do not see that the worker2 enters the error state.

Configuration:
Webserver: Apache 2.0.58 on Solaris 8 with worker MPM, with ThreadsPerChild 
sets to 75

worker.properties for mod_jk 1.2.15:
worker.worker2.type=ajp13
worker.worker2.host=192.168.0.3
worker.worker2.port=1234
worker.worker2.lbfactor=50
worker.worker2.cache_timeout=600
worker.worker2.recycle_timeout=600
worker.worker2.socket_timeout=62
worker.worker2.sticky_session=1
worker.worker2.prepost_timeout=30000
worker.worker2.recovery_options=0
worker.worker2.reply_timeout=600000
worker.worker2.retries=1

worker.lbworker.type=lb
worker.lbworker.balance_workers=worker4,worker3,worker2,worker1
worker.lbworker.sticky_session=1
worker.lbworker.local_worker_only=0
worker.lbworker.retries=1

Tomcat 5.0.28:
    <Connector className="org.apache.coyote.tomcat5.CoyoteConnector"
               port="1234"  minProcessors="5" maxProcessors="750"
               acceptCount="10" debug="0" enableLookups="true" 
redirectPort="8443"
                connectionTimeout="200000" useURIValidationHack="false"
                protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" 
/>

regards Henk Fictorie
-- 
Henk Fictorie
KPN.com
phone: +31 70 3438362
mobile: +31 6 51379479
email: henk.fictorie@kpn.com






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