You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Ch...@findexa.no on 2003/09/15 13:41:38 UTC

Is HttpClient with MultiThreadedHttpConnectionManager a connectio n pool?

I didn't find a user list for HttpClient so I'm posting this to the dev
list.

We are switching our backend from JDBC to XML via HTTP.

At peak hours we need to make up to 20 asynchronous requests per second.

We are looking for a HTTP lib that provides some kind of "connection
pooling" so that each request does not result in a new HTTP connection
negotiation. 

The "threading" section of the HttpClient docs states:
"In general the connection manager makes an attempt to reuse connections for
a particular host while still allowing different connections to be used
simultaneously. Connection are reclaimed using a least recently used
approach."

Does this mean that an instance of HttpClient with
MultiThreadedHttpConnectionManager provides the functionality we are looking
for?

Kind regards
Christian NedregÄrd


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Re: Is HttpClient with MultiThreadedHttpConnectionManager a connectio n pool?

Posted by Adrian Sutton <ad...@intencha.com>.
Hi Christian,

> I didn't find a user list for HttpClient so I'm posting this to the dev
> list.

This list functions as both the development and user list for HttpClient.
Though you could use the commons-user list for user queries as well it's
easier to keep everything together here and increases your chances of
getting a quick response.

> We are switching our backend from JDBC to XML via HTTP.
> 
> At peak hours we need to make up to 20 asynchronous requests per second.
> 
> We are looking for a HTTP lib that provides some kind of "connection
> pooling" so that each request does not result in a new HTTP connection
> negotiation. 
> 
> The "threading" section of the HttpClient docs states:
> "In general the connection manager makes an attempt to reuse connections for
> a particular host while still allowing different connections to be used
> simultaneously. Connection are reclaimed using a least recently used
> approach."
> 
> Does this mean that an instance of HttpClient with
> MultiThreadedHttpConnectionManager provides the functionality we are looking
> for?

Yes, MultiThreadedHttpConnectionManager will pool connections for reuse.  It
is important to note that you may need to tweak the way it works to optimise
it for your application.  By default it limits itself to creating 2
simultaneous connections to any one host and has an upper limit to the total
number of connections as well.  Both these limits can be configured and
depending on your exact use case may need to be increased to avoid threads
blocking while waiting for a connection to become available.

> Kind regards
> Christian NedregÄrd

Hope that helps,

Adrian Sutton.

----------------------------------------------
Intencha "tomorrow's technology today"
Ph: 38478913 0422236329
Suite 8/29 Oatland Crescent
Holland Park West 4121
Australia QLD
www.intencha.com


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org