hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <andrew.ada...@thomson.com>
Subject Performance of stale connection check
Date Wed, 21 Feb 2007 22:13:56 GMT
Hi!
 
Are there any plans to improve performance of the stale connection
check?  
 
Unfortunately, we can not currently migrate to HttpClient because we
can't afford 15-30 ms for stale checks in our environment where complete
HTTP requests take 10 ms.  We do need the robustness provided by stale
checks so disabling them is not a good option for us.
 
One way to implement fast stale checks is to use non-blocking reads with
channels:
 
        try {
            channel.configureBlocking( false );            
            count = channel.read( buffer );
            // connection closed if count == -1 (log EOF)
        }
        catch( Exception e ) {            
            // connection reset (log exception)
        }
        finally {
            channel.configureBlocking( true );
        }
 
This code successfully detects closed and aborted/reset connections, and
runs in < 1 ms.
 
Thanks.
 
- Andrew
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message