tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <mt...@apache.org>
Subject Tomcat keepAliveTimeout
Date Fri, 29 Sep 2006 15:18:22 GMT
Hi,

The problem is that we presume that socket timeout
is keep-alive timeout, and that is wrong.
The reason is simple because the time between two
requests has noting to do with the the time the data
will be read.

Also, the thing like reading the request is dependent
on the number of client connections!!! (very stupid)
It means that the user and admin could not be sure
what the actual timeout is.

int threadRatio = (endpoint.getCurrentThreadsBusy() * 100)
         / endpoint.getMaxThreads();
if ((threadRatio > 33) && (threadRatio <= 66)) {
     soTimeout = soTimeout / 2;
} else if ((threadRatio > 66) && (threadRatio <= 90)) {
     soTimeout = soTimeout / 3;
     keepAliveLeft = 1;
} else if (threadRatio > 90) {
     soTimeout = soTimeout / 20;
     keepAliveLeft = 1;
}

It means that the timeout for the request can be
soTimeout, soTimeout/2 or soTimeout/20 !
Now, how can one deduct what the timeout is.

The code was probably made to deal with the high load.
But, what If I know what my load will be, and I'm sure
it'll never go over the maxThreads?
It would mean that half of my connections will have 10sec
timout, one third will have 3 secs, and the 10 percent of them
will have 0 sec timeout.
Now that sucks major!

Comments?

--
Mladen.






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


Mime
View raw message