Question

I have read that connection timeout in server.xml just close connection in case of timeout but it would not stop thread which is going processing for request. In that case what we are achieving by closing connection?

I am not sure how much resources are occupied by a connection, I thought closing connection will just release socket (some memory). I just want to understand real advantage of this flag.

Was it helpful?

Solution

The Apache Tomcat connectionTimout is described in the documentation as

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).

It defines the amount of time the connection is held open. As for the question of why close connections, again from Apache documentation,

Setting communication timeouts is very important to improve the communication process. They help to detect problems and stabilise a distributed system.

In short, you are achieving stability and effective error logging by making sure your connection pool is clean.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top