You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Jordi Domingo Borràs <jo...@gmail.com> on 2011/04/27 17:51:48 UTC

Connection pool timeout

Hi :)

Is there a way to specify a TIMEOUT value for connections to other hosts and
another TIMEOUT for waiting a free connection from the pool?

I found in previous versions ConnManagerPNames.TIMEOUT and
CoreConnectionPNames.
CONNECTION_TIMEOUT but now theres only
CoreConnectionPNames.CONNECTION_TIMEOUT.

Thanks in advance.

Re: Connection pool timeout

Posted by Jordi Domingo Borràs <jo...@gmail.com>.
Thanks a lot Oleg!! Thanks :)

On Sat, Apr 30, 2011 at 13:21, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Thu, 2011-04-28 at 17:25 +0200, Jordi Domingo Borràs wrote:
> > Hi Oleg,
> >
> > It would be great to have another parameter. This is really useful for
> me,
> > I'm sorry if my english is not as good as it should be
> > in order to explain it better.
> >
> > I need to load a lot of url's. I need to load them whenever connections
> from
> > pool are  available, it doesnt matter if its now or in 10 minutes. -->
> > TIMEOUT value infinite
> > I dont want to block a connection more than 10 seconds waiting for a
> > response from server. TIMEOUT value 10 seconds
> >
> >
> > Thanks again Oleg,
> >
> > Jordi
> >
>
> Jordi
>
> You can now set a timeout for connection manager operations with
>
> ConnManagerParams#setTimeout() when using the latest snapshot off the
> 4.1.x branch or
>
> HttpClientParams#setConnectionManagerTimeout() when using the latest
> snapshot off the trunk (4.2)
>
> Oleg
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Re: Connection pool timeout

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2011-04-28 at 17:25 +0200, Jordi Domingo Borràs wrote:
> Hi Oleg,
> 
> It would be great to have another parameter. This is really useful for me,
> I'm sorry if my english is not as good as it should be
> in order to explain it better.
> 
> I need to load a lot of url's. I need to load them whenever connections from
> pool are  available, it doesnt matter if its now or in 10 minutes. -->
> TIMEOUT value infinite
> I dont want to block a connection more than 10 seconds waiting for a
> response from server. TIMEOUT value 10 seconds
> 
> 
> Thanks again Oleg,
> 
> Jordi
> 

Jordi

You can now set a timeout for connection manager operations with 

ConnManagerParams#setTimeout() when using the latest snapshot off the
4.1.x branch or

HttpClientParams#setConnectionManagerTimeout() when using the latest
snapshot off the trunk (4.2)

Oleg




---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Connection pool timeout

Posted by Jordi Domingo Borràs <jo...@gmail.com>.
Hi Oleg,

It would be great to have another parameter. This is really useful for me,
I'm sorry if my english is not as good as it should be
in order to explain it better.

I need to load a lot of url's. I need to load them whenever connections from
pool are  available, it doesnt matter if its now or in 10 minutes. -->
TIMEOUT value infinite
I dont want to block a connection more than 10 seconds waiting for a
response from server. TIMEOUT value 10 seconds


Thanks again Oleg,

Jordi


On Thu, Apr 28, 2011 at 17:09, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Thu, 2011-04-28 at 16:10 +0200, Jordi Domingo Borràs wrote:
> > Im using a ThreadSafeClientConnManager with a max total of 50. If all of
> > them are busy,
> > waiting resources will timeout and I dont want this.
> >
> > On the other side, if a timeout waiting for a connection to be
> established
> > occurs, I will
> > retry twice and then assume site is down.
> >
> > I dont care if a connection is served from the pool or is new.
> >
> > Thanks,
> > Jordi
> >
> >
>
> I am not sure I fully understand why this is useful, but I can
> re-introduce a separate parameter for connection manager timeout, if
> necessary.
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Re: Connection pool timeout

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2011-04-28 at 16:10 +0200, Jordi Domingo Borràs wrote:
> Im using a ThreadSafeClientConnManager with a max total of 50. If all of
> them are busy,
> waiting resources will timeout and I dont want this.
> 
> On the other side, if a timeout waiting for a connection to be established
> occurs, I will
> retry twice and then assume site is down.
> 
> I dont care if a connection is served from the pool or is new.
> 
> Thanks,
> Jordi
> 
> 

I am not sure I fully understand why this is useful, but I can
re-introduce a separate parameter for connection manager timeout, if
necessary.

Oleg  



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Connection pool timeout

Posted by Jordi Domingo Borràs <jo...@gmail.com>.
Im using a ThreadSafeClientConnManager with a max total of 50. If all of
them are busy,
waiting resources will timeout and I dont want this.

On the other side, if a timeout waiting for a connection to be established
occurs, I will
retry twice and then assume site is down.

I dont care if a connection is served from the pool or is new.

Thanks,
Jordi


On Thu, Apr 28, 2011 at 15:32, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Thu, 2011-04-28 at 12:32 +0200, Jordi Domingo Borràs wrote:
> > Hi Oleg,
> >
> > I need an infinite timeout waiting for a connection from the pool ( i
> need
> > the resource to load, whenever possible, doesnt matter if its now or in 5
> > min).
> > I need a low value timeout when connecting to a host.
> >
>
> But why? Why do you care if a connection has been served from the pool
> or newly created? In both cases one simply needs to ensure that I/O
> threads do not get blocked indefinitely while waiting for a connection
> to be established.
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Re: Connection pool timeout

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2011-04-28 at 12:32 +0200, Jordi Domingo Borràs wrote:
> Hi Oleg,
> 
> I need an infinite timeout waiting for a connection from the pool ( i need
> the resource to load, whenever possible, doesnt matter if its now or in 5
> min).
> I need a low value timeout when connecting to a host.
> 

But why? Why do you care if a connection has been served from the pool
or newly created? In both cases one simply needs to ensure that I/O
threads do not get blocked indefinitely while waiting for a connection
to be established.

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Connection pool timeout

Posted by Jordi Domingo Borràs <jo...@gmail.com>.
Hi Oleg,

I need an infinite timeout waiting for a connection from the pool ( i need
the resource to load, whenever possible, doesnt matter if its now or in 5
min).
I need a low value timeout when connecting to a host.

Now when a connection pool timeout occurs I queue it again but i'm not happy
with this.

I think that increasing the pool size will not be good for my BW.

Thanks,
Jordi

On Wed, Apr 27, 2011 at 21:51, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Wed, 2011-04-27 at 17:51 +0200, Jordi Domingo Borràs wrote:
> > Hi :)
> >
> > Is there a way to specify a TIMEOUT value for connections to other hosts
> and
> > another TIMEOUT for waiting a free connection from the pool?
> >
>
> Not any more. What are the reasons you would like to use different
> timeout values for these two operations?
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Re: Connection pool timeout

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2011-04-27 at 17:51 +0200, Jordi Domingo Borràs wrote:
> Hi :)
> 
> Is there a way to specify a TIMEOUT value for connections to other hosts and
> another TIMEOUT for waiting a free connection from the pool?
> 

Not any more. What are the reasons you would like to use different
timeout values for these two operations?

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org