On Mon, 2008-12-22 at 06:41 -0800, TomStrummer wrote:
> 
> olegk wrote:
> > 
> > I think so, but I just do not see a point. Why not just setting a higher 
> > connections per host number? TSCM does not pre-allocate connections, so 
> > the pool will never grow, unless really needed.
> > 
> 
> I guess the difference is ThreadPoolExecutor sets a TTL on Thread instances
> so in addition to being able to scale up, it can scale back down.  If, for
> instance, there is a burst in requests then a drop, a large number of
> objects are not left in the pool.  I guess this question is mostly academic
> since I don't really have much of a use case behind what I'm asking for.  I
> originally would have had the "max concurrent request count" be a mutable
> property on my AsyncHTTPBuilder class rather than a final value set in a
> constructor.  But since TSCCM's pool size is not dynamic, it means mine
> can't be either unless I create a new one each time the value is changed --
> which I don't want to do.  But anyway, it is not really a problem.
> 
> 

TSCM is perfectly capable of reducing the size of its pool after a spike
of activity. It will be gradually removing connections from the pool as
they become expired. One can have a better control of this process by
running a helper thread and calling #closeExpiredConnections() or
#closeIdleConnections() every once in a while.

That's why I personally see no harm in keeping the maximum number of
connections per host set to a fairly high value, as long as you do not
mind having lots and lots of connections as a result of a sudden burst
of requests.

Hope this helps

Oleg  

> 
> olegk wrote:
> > 
> > I have not used retrotranslator myself so I cannot really tell.
> > 
> > We held a poll on the minimal JRE level for HttpClient 4.0 about a year 
> > ago, and if my memory does not fail me, not a single person voted in 
> > favor of 1.4 compatibility:
> > 
> 
> If HC 4 is built with maven, it's easy to add in Retrotranslator via the
> plugin:
> http://mojo.codehaus.org/retrotranslator-maven-plugin/examples/project-translation.html
> 
> But i suppose I don't have a real requirement for that either, I would have
> done it "just because" :)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to