You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by vichi <vi...@gmail.com> on 2009/11/12 10:54:24 UTC

Connection Timeout

i want to close a connection if i don't get response back in specific time
(let say in 30 sec) . is there any setting in tomcat for this purpose.

Test case: " I deployed a servlet in my stand alone tomcat. that servlet has
thread.sleep(50000) code in it. i want that if a user send a request and he
doesnt get response back in 3 sec then tomcat close the connection which was
opened for that request and so user doesnt get any response. since my
servlet has thread.sleep(50000) code in it so to genrate a response will
take at least 5sec. in sort if response time is more than 3 second the
tomcat should close connection and user should not get any response
back"......is there any setting or facility provided by tomcat if not how
can i do it.

i am using tomcat:-5.5.23 , OS:- Windos XP, Connector:- non-SSL HTTP/1.1
Connector

please need an urgent help
-- 
View this message in context: http://old.nabble.com/Connection-Timeout-tp26315289p26315289.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


RE: Connection Timeout

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: vichi [mailto:vichi100@gmail.com]
> Subject: Re: Connection Timeout
> 
> does closing a connection will free http thread?

No; the thread does not return to the pool until the webapp logic is completed.  You'll need to have the webapp monitor itself.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: Connection Timeout

Posted by vichi <vi...@gmail.com>.
thanks Martin for valuable help. In my project i m using embedded  tomcat
server 5.5.23 and with http connector .  my project is a middle ware
product. so using my product a customer can create his application. since my
product use embedded  tomcat server so if a user send any request it comes
to tomcat which froward request to either jsp or servlet. so my customer
wants me to do if generating a response takes more than 5 sec (let say if
response is not committed within 5 sec) then tomcat should close that
connection so that the http thread(since for each request tomcat server
assign a thread) which is processing the request for response will get free
and will be available to accept new request.

does closing a connection will free http thread?

thanks,
-vichi

Martin Choma wrote:
> 
> Here are some timeout settings
> http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html.
> 
> Can I ask, what brings you to such requirements. I consider it for
> little bit unusual. So what is your case originally? If you tell us,
> maybe another solution could be take.
> 
> Martin
> 
> 2009/11/12 vichi <vi...@gmail.com>:
>>
>> i want to close a connection if i don't get response back in specific
>> time
>> (let say in 30 sec) . is there any setting in tomcat for this purpose.
>>
>> Test case: " I deployed a servlet in my stand alone tomcat. that servlet
>> has
>> thread.sleep(50000) code in it. i want that if a user send a request and
>> he
>> doesnt get response back in 3 sec then tomcat close the connection which
>> was
>> opened for that request and so user doesnt get any response. since my
>> servlet has thread.sleep(50000) code in it so to genrate a response will
>> take at least 5sec. in sort if response time is more than 3 second the
>> tomcat should close connection and user should not get any response
>> back"......is there any setting or facility provided by tomcat if not how
>> can i do it.
>>
>> i am using tomcat:-5.5.23 , OS:- Windos XP, Connector:- non-SSL HTTP/1.1
>> Connector
>>
>> please need an urgent help
>> --
>> View this message in context:
>> http://old.nabble.com/Connection-Timeout-tp26315289p26315289.html
>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Connection-Timeout-tp26315289p26319222.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Connection Timeout

Posted by Martin Choma <ma...@gmail.com>.
Here are some timeout settings
http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html.

Can I ask, what brings you to such requirements. I consider it for
little bit unusual. So what is your case originally? If you tell us,
maybe another solution could be take.

Martin

2009/11/12 vichi <vi...@gmail.com>:
>
> i want to close a connection if i don't get response back in specific time
> (let say in 30 sec) . is there any setting in tomcat for this purpose.
>
> Test case: " I deployed a servlet in my stand alone tomcat. that servlet has
> thread.sleep(50000) code in it. i want that if a user send a request and he
> doesnt get response back in 3 sec then tomcat close the connection which was
> opened for that request and so user doesnt get any response. since my
> servlet has thread.sleep(50000) code in it so to genrate a response will
> take at least 5sec. in sort if response time is more than 3 second the
> tomcat should close connection and user should not get any response
> back"......is there any setting or facility provided by tomcat if not how
> can i do it.
>
> i am using tomcat:-5.5.23 , OS:- Windos XP, Connector:- non-SSL HTTP/1.1
> Connector
>
> please need an urgent help
> --
> View this message in context: http://old.nabble.com/Connection-Timeout-tp26315289p26315289.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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