you are correct, soTimeout should not, imho, change depending on the
thread count.
if the user sets 20 seconds for soTimeout then it should stay that way.
on blocking io, soTimeout naturally becomes keepAliveTimeout, as when
the request is complete, you go into read() again.
on non blocking io this is different, but here we use the same timeout
during the polling stage and timeout the connections that way.
I see how soTimeout would be different from keepAlivetimeout when the
servlet is invoking a blocking read on the servletinputstream.
in that case they might want a keepalivetimeout to be fairly long, maybe
15 seconds, and soTimeout to be short, like less than 1 second.
but this scenario becomes tricky, if you timeout on a servletinputstream
read, is that an exception that the servlet should catch, and does it
mean that the request is complete, or should the servlet attempt the
read again?
I think we would have to identify the behavior here before we implement
the change, that way we can have a consistent implementation across all
connectors
Filip
Mladen Turk wrote:
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., imho
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]