You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Patrick Lightbody <Pa...@spokesoftware.com> on 2003/08/19 01:42:12 UTC
HttpClient slowness
We're noticing around a 150ms overhead and ALL calls (GETs, POSTs, etc)
when using HTTPClient (tried everything between 2.0 alpha 3 and 2.0
RC1). The strange thing is that sometimes those overheads drop down to
5ms, which is much better and what we expect. Unfortunately, we haven't
been able to pinpoint _why_ those drops take place yet.
We've played with various app servers (Resin 2.x and Tomcat 4.1.x),
using various connectors and connection pools, and nothing seems to help
out here. We're using HTTP 1.1 and keep alives, and the server and
client are on the same machine so network latency is not an issue.
If I use nogoop's HTTP Client or even the JDK's URLConnection, I can get
responses back around 5ms like I'd expect. Has anyone experienced
something like this? Any thoughts as to what is going on with
HTTPClient?
-Pat
Re: HttpClient slowness
Posted by Michael Becke <be...@u.washington.edu>.
Hi Pat,
There are a couple of possibilities. Most likely one of the following
is happening:
- You are experiencing a known slowdown due to
HttpConnection.isStale(). This causes a constant slowdown for every
method execution. This is to ensure that a connection is still open
before it is used. It seems to effect some platforms more than others.
It can be disabled in each of the two connections managers by setting
connectionStaleCheckingEnabled to false.
- You are using a 1.4.0_xx JVM. There is a known bug in 1.4.0 JVMs
using socket timeouts.
<http://developer.java.sun.com/developer/bugParade/bugs/4512028.html>
- You are using HTTPS in a pre 1.4 JVM. Again
HttpConnection.isStale() is the culprit. Sun JVMs < 1.4 force the
connection to be closed after calling isStale(). This means
connections must be opened for each method execution.
Mike
On Monday, August 18, 2003, at 07:42 PM, Patrick Lightbody wrote:
> We're noticing around a 150ms overhead and ALL calls (GETs, POSTs, etc)
> when using HTTPClient (tried everything between 2.0 alpha 3 and 2.0
> RC1). The strange thing is that sometimes those overheads drop down to
> 5ms, which is much better and what we expect. Unfortunately, we haven't
> been able to pinpoint _why_ those drops take place yet.
>
> We've played with various app servers (Resin 2.x and Tomcat 4.1.x),
> using various connectors and connection pools, and nothing seems to
> help
> out here. We're using HTTP 1.1 and keep alives, and the server and
> client are on the same machine so network latency is not an issue.
>
> If I use nogoop's HTTP Client or even the JDK's URLConnection, I can
> get
> responses back around 5ms like I'd expect. Has anyone experienced
> something like this? Any thoughts as to what is going on with
> HTTPClient?
>
> -Pat
>