You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Yogesh Patel <yo...@highq.com> on 2015/12/11 07:56:36 UTC

maxConnection and keepAliveTimeout

Hi All,

*If we do not configure "maxConnections" then it will take default value as
maxThread (which is 200) and "keepAliveTimeout" will take default value of
connectionTimeout (which is 60 seconds) then what is a impact of
configuring these parameteres?*

*What value for "keepAliveTimeout" will be consider as the best?*

-- 
*Thanks & Regards,*

* Yogesh Patel*

Re: maxConnection and keepAliveTimeout

Posted by "André Warnier (tomcat)" <aw...@ice-sa.com>.
On 11.12.2015 07:56, Yogesh Patel wrote:
> Hi All,
>
> *If we do not configure "maxConnections" then it will take default value as
> maxThread (which is 200) and "keepAliveTimeout" will take default value of
> connectionTimeout (which is 60 seconds) then what is a impact of
> configuring these parameteres?*
>
> *What value for "keepAliveTimeout" will be consider as the best?*
>
hi.

This must already have been answered a million times on this list and others, but anyway :

1) https://en.wikipedia.org/wiki/HTTP_persistent_connection

...

"Disadvantages

If the client does not close the connection when all of the data it needs has been 
received, the resources needed to keep the connection open on the server will be 
unavailable for other clients. How much this affects the server's availability and how 
long the resources are unavailable depend on the server's architecture and configuration.
"

Imagine the case of a browser requesting a html page from a server, and receiving back a 
page which contains 30 further links to other resources on the server, all needed to 
represent the initial page correctly (css,javascript,images,..).
The keep-alive setting is meant to allow the browser to fetch these additional resources, 
using the same initial TCP connection, instead of having to re-build a separate connection 
for each of these additionaln resource calls.

The keep-alive timeout kicks in each time the server has finished serving one resource to 
the browser.  The server then waits (with the connection still open) for another "timeout 
seconds", to see if the browser sends any other request on the same connection.  If the 
timeout is reached without the server receiving any additional request, the server closes 
the connection, /and can free the resources that were waiting on that connection/.

In modern infrastructures, if the server does not receive any more requests on a 
connection after a few seconds, it is likely that the browser is not going to send any 
additional requests there.  So it is better to free such a connection relatively quickly 
(lile, 5 s), to allow the server resources to process other requests instead.

And by the way, I would also lower the connectionTimeout, if I was you.
Just to reduce the possibility of one form of DOS attack.



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


Re: maxConnection and keepAliveTimeout

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Yogesh,

On 12/11/15 1:56 AM, Yogesh Patel wrote:
> *If we do not configure "maxConnections" then it will take default value as
> maxThread (which is 200) and "keepAliveTimeout" will take default value of
> connectionTimeout (which is 60 seconds) then what is a impact of
> configuring these parameteres?*

André already answered your real question, but I figured I'd mention
that the maxConnections/maxThreads settings have absolutely no bearing
on the keepAliveTimeout and connectionTimeout. They are independent.

-chris

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