top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

HTTP connection timeout using Tomcat 6

0 votes

Using tomcat 6.I Always confused with connectionTimeout

The number of milliseconds this *Connector* will wait, after accepting a connection, for the request URI line to be presented. The default value is 60000 (i.e. 60 seconds).

Helpful if anyone can explain.?

Is there any connector parameter where i can set request timeout.?Rather than at application level timeout i want tomcat to timeout after certain period if request taking long time..

posted Jul 12, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

The Connector's are "shared" by all Hosts and all applications. So the connectionTimeout is already global for all requests that come in on the corresponding Connector port.

This parameter is there specifically to fight one type of Denial-Of-Service attack, whereby some malicious client(s) create a TCP connection to the server (which has the effect of reserving some resources on the server for handling this connection), and then just sit there without sending any HTTP request on that connection. By making this delay shorter, you shorten the time during which the server resources are
allocated, to serve a request that will never come.
This has to be balanced against legitimate clients which may be slow in sending the request line. But 60 seconds is a really long time to wait for such legitimate client requests nowadays. You can probably lower that to 5000 (= 5 s.) without any ill effect on the legitimate clients.

Note that as soon as the HTTP request line has been received, this timeout plays no role anymore. So it is not usable to limit the time that an application requires to process and respond to the request. As far as I know, there is no standard parameter available in Tomcat to do that. Which is also rather understandable, because Tomcat has no idea what kind of delay makes sense for any particular application with any particular request parameters. Only you would know that, on a call-by-call base.

Final note : if a browser makes a request to a HTTP server, and does not get any response for about 5 minutes, the browser will time out and show an error message like "the server is not responding" etc..

answer Jul 12, 2013 by anonymous
Similar Questions
0 votes

I am running Apache Tomcat 7.0.4 on Linux and the session-timeout is configured to 30 minutes. All requests from my client pass in the session cookie. However, I do not want the session timeout counter to get reset for certain URLs.

Is there a way to configure Tomcat to ignore certain URLs when resetting its timeout counter for a particular session?

0 votes

I have written a PKI proxy servlet to support a tool that needs access to my customer's secured web site, but the application does not support client certificate security. The Servlet works great when called from a browser, where the proxy uses a B2B certificate for access and forwards the response to the browser as expected. That seemed like a good prototype, however, when I went to test against the tool I found that it was not making a GET request, but rather a CONNECT request. I extended my code to accept the CONNECT, however the request never seems to get past the front door Tomcat. None of my code is ever called, so I have to assume that I have a setting wrong in Tomcat.

Everything I can find online discusses how you should not have a Tunneling proxy in your infrastructure, but this is all in a secured environment, not on the internet, so this is not an issue and has been approved. Is there something I am missing?

+2 votes

I desire for using tomcat as the websocket server. But I'm now wondering about the tomcat performance. Does anyone know the max connections that tomcat could held? the concurrent number requests?

And I don't quite understand the configurations - acceptCount & maxConnections & maxThreads

There must be some relationship between the three params.

If I set [ accpetCount=200, maxConnections=10000, maxThreads=100] dose it means:
1. the max connections that tomcat maintain with the client is 10000. and if the 10001 client's connect request is coming, the client will timeout.
2. the max request is 200, and the 201 request will be refused.
3. the max concurrent request is 100.

+1 vote

In tomcat does the no . of open sockets on http port (netstat -anlp|grep 8080) is it equal to number of threads in use in tomcat .
Actually I want to understand how & when I can say that the all threads in a tomcat are fully utilized that why it is responding slow.

+1 vote

We have a set up like Apahce (80,443) redirects the request to Tomcat (8080) using mod_jk.

The new requirement is to route the request from the same apache to another tomcat (8090). Hence I made the different config file for apache with different ports (86,4444) and different worker for mod_jk which routes the request to tomcat.

Now the issue is when I hit the url http://:86 and after providing the credentials, it is redirecting to https://:86 and throwing the below error.

Error in browser:

Secure Connection Failed

An error occurred during a connection to x.x.x.x:86. SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long)

Error in logs:

"x16x03x01" 501

[Thu Jan 08 08:22:46 2015] [debug] ssl_engine_io.c(1523): OpenSSL: I/O error, 11 bytes expected to read on BIO#1bf568 [mem: 1f3930]
[Thu Jan 08 08:22:46 2015] [debug] ssl_engine_kernel.c(1806): OpenSSL: Exit: error in SSLv2/v3 read client hello A
[Thu Jan 08 08:22:46 2015] [info] (70014)End of file found: SSL handshake interrupted by system [Hint: Stop button pressed in browser?!]
[Thu Jan 08 08:22:46 2015] [info] Connection to child 3 closed with abortive shutdown(server [2], client
[Thu Jan 08 08:23:53 2015] [error] [client] Invalid method in request x16x03x01

Could you please suggest where it might went wrong and the way forward..

Useful Links with Similar Problem
Contact Us
+91 9880187415
#470/147, 3rd Floor, 5th Main,
HSR Layout Sector 7,
Bangalore - 560102,
Karnataka INDIA.