top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

HTTP connection timeout using Tomcat 6

0 votes
1,067 views

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 LinkedIn 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
+1 vote

I had installed tomcat 8 port 80 on Amazon AWS EC2, but netstat, fuser does show me tomcat on port 80. Browser gives 404 error and connection refused. I wrote to Amazon support for the misery...

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.

...