You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Aurélien Pernoud <ap...@sopragroup.com> on 2002/05/31 16:24:00 UTC

[HttpClient] Bad performance with multiple request to same host ?

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 java.net, 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
requests.

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
time

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.

Sincerely,
Aurelien Pernoud


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>