commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aurélien Pernoud <>
Subject [HttpClient] Bad performance with multiple request to same host ?
Date Fri, 31 May 2002 14:24:00 GMT

Hi there,

I'm knew in using HttpClient and here is what I want to do :

I'm building a webapp using jetspeed and portlets. Portlets are getting
their content from a servlet on a distant server, so I can't use the
"include" method in servlets response.

I tried using the HttpURLConnection of, it's working so far, but I
have bad performance results when many portlets try to connect to the
distant servlet, but it doesn't come from this servlet (the average response
time is less than 20ms with 50 users...). Getting the inputstream can take
up to 300 ms, and it's not acceptable.

So after searching on the web, I found the HttpClient, and tried to use it.
That seemed perfect, cause I only used on HTTPConnection to make all my

But performance are even worse, with only one user, so I don't get it ...

Here are my tries, only for one user yet :

- At login of user :
	1st try : create a httpclient and start a session with the distant servlet
	2nd try : create a httpmulticlient

- each portlet has its own method associated

- When getting content of the portlets :
	1st try : use the httpclient to execute the method, get the responsebody as
stream of the method
	2nd try : same as above (nearly)

The response time to execute one request and get the inputstream is around
400ms, for only one user. I don't get it, but didn't find any help on how to
use the httpclient.

I was very interested with the recycle() function though, but didn't had any
effect. Seems it looses the connection established with the servlet every

I tried both the release version (2.0 alpha) and the latest nightly build,
nothing changed.

I'm stuck at this point, any help would be really appreciated.

Aurelien Pernoud

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message