简体   繁体   中英

Tomcat server.xml connection timeout configuration

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.

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 (ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM