hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Thompson" <Tony.Thomp...@stone-ware.com>
Subject Performance issues in ChunkedInputStream
Date Wed, 11 Apr 2007 01:29:53 GMT
I am having what I consider a fairly significant performance issue with
a ChunkedInputStream in the 3.0.1 client.  I have been packet tracing a
conversation using the HttpClient where the response is chunked and my
application is reading the response stream directly from the method I
executed.  On the wire, frequently during a large chunked response I see
"ZeroWindow" responses from my client to the server which would indicate
that the HttpClient is not getting the data off the wire fast enough.  I
have tried making the BufferedInputStream in HttpConnection large (128K)
and it still fills up (it just takes a little longer).
So, after doing some profiling of ChunkedInputStream I found that a huge
amount of time is spent in
ChunkedInputStream.getChunkSizeFromInputStream().  In the very short
profiling session I ran, ChunkedInputStream.read( byte[], int, int ) was
invoked 2424 times and the time spent in that method (excluding further
method calls) was 870ms.  getChunkSizeFromInputStream() was invoked 432
times and the time spent in that method was 27762ms (excluding further
method calls).  Does someone who understands that code better than I
have any idea how that can be improved?
One other issue I have with that code is if I interrupt the file
transfer and call method.abort(), that ChunkedInputStream appears to
still keep pulling data from the host.  Wouldn't it just make more sense
to just close down that connection instead of making it sit there and
pull data that is just dumped into the bit bucket?  It could sit there
and just waste bandwidth if the chunked response is large.  I am also
using the idle connection timer with the connection manager and I
frequently see connections like that abandoned, the idle timer kicks in
and just resets the socket.
Thanks for any help.
This message (and any associated files) is intended only for the 
use of the individual or entity to which it is addressed and may 
contain information that is confidential, subject to copyright or
constitutes a trade secret. If you are not the intended recipient 
you are hereby notified that any dissemination, copying or 
distribution of this message, or files associated with this message, 
is strictly prohibited. If you have received this message in error, 
please notify us immediately by replying to the message and deleting 
it from your computer. Messages sent to and from Stoneware, Inc.
may be monitored.

  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message