tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: Canceling Download on IIS7 with ISAPI Redirector 1.2.31 causes 100% CPU usage
Date Sat, 14 May 2011 20:01:00 GMT
eurotrans-Verlag wrote:
> Hi André, thanks for your reply.
> 
>> To figure out if this is what's happening, you could do some logging at
>> the servlet end,
>> to see if it keeps sending data even when the client has canceled, or
>> if it itself gets
>> some stop indication from the isapi_redirector (also a closed socket
>> e.g.).
>>
>> Or else Mladen or Rainer could tell us if I'm totally off-base here.
> 
> 
> I added some logging to the Servlet to see what it is actually doing
> (logging the start and end of the doGet() method and every time 2 MB are
> written, and I also put the write loop in a try-catch clause to catch
> IOException).
> 
> You are right: When I start the download, the servlet writes the bytes
> slowly (due to the speed of the Connection) to the output. However, when I
> then cancel the download, it writes the remaining bytes very fast, probably
> causing the high CPU usage of the ISAPI redirector.
> 
> But in some cases, the result is another: After I canceled the download, the
> write() method throws an IOException:
> ClientAbortException:  java.io.IOException: Failed to send AJP message
> 
> and the remaining bytes are not written, so the CPU usage does not go up to
> 100% (That's probably the other case I mentioned before, that sometimes the
> CPU usage doesn't go up).
> 
> However I would expect write() to always throw an IOException when the
> connection to the client is aborted, 

Remember, there are 2 separate connections : the connection of the client to 
IIS+isapi_redirector, and the connection from IIS+isapi_redirector to Tomcat+servlet.
The servlet will only throw an I/O exception if that second connection is closed.

So it all depends on whether the isapi_redirector closes the connection to Tomcat also, 
when the client has closed its connection to IIS.

but it seems that in most cases, the
> IOException is not thrown, thus causing the servlet to write the remaining
> bytes very fast to the ISAPI redirector and probably causing the high CPU
> load.
> Do you or anybody have an idea why sometimes the IOException is not thrown
> when the Client aborts the Connection?
> 
I have no idea.  We need Mladen or Rainer here..

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


Mime
View raw message