I think we can tell the server that we want persistent connection by settting the Http 
header provided that the server supports persistency
method.setRequestHeader("Connection","keep-alive");

________________________________

From: Michael Becke <[EMAIL PROTECTED]>@CHOICEPOINT [mailto:Michael Becke <[EMAIL 
PROTECTED]>@CHOICEPOINT]
Sent: Thu 6/17/2004 6:54 AM
To: Commons HttpClient Project
Subject: Re: Connection Keep Alive feature and multi threaded connection manager



Hi Juan,

If the server does not support persistent connections then, as you say,

reusing connections will not help performance much.  The only benefit I

can see is in the reduction of objects being created.  Reusing the

connection manager will reduce the instances of

SimpleHttpConnectionManager and HttpConnection that are created.  Also,

if in the future, if the server began supporting persistent connections

then you would be ahead of the game.

Mike

On Jun 17, 2004, at 5:04 AM, Juan Pedro López Sáez wrote:

> Hello everybody.

>

> One of my applications is using HttpClient to connect to an external

> server and send some data.

>

> It's a multi threaded application in which every new thread creates a

> HttpClient object with the simple connection manager to do its job.

>

> As a general rule, I want to switch to the multi threaded manager in

> most of my applications to improve the overall performance.

>

> I've recently found out that the server closes every HTTP connection

> after sending back the response to my post request.

>

> So in this scenario, I guess the connection pool supplied by the multi

> threaded manager won't improve anything when connecting to that server.

>

> The question is: is there any other advantage in using the multi

> threaded manager instead of the simple one in this situation or should

> I

> leave things unchanged in this application?

>

> Thank you very much.

>

>       Juan Pedro Lopez

> -

>

>

> ---------------------------------------------------------------------

> To unsubscribe, e-mail:

> [EMAIL PROTECTED]

> For additional commands, e-mail:

> [EMAIL PROTECTED]

>


---------------------------------------------------------------------

To unsubscribe, e-mail: [EMAIL PROTECTED]

For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to