hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sachin Nikumbh <saniku...@gmail.com>
Subject Re: Question about IOReactorConfig.soTimeout and IOReactorConfig.ioThreadCount
Date Fri, 09 Nov 2012 21:17:58 GMT
Hi Oleg,

Thanks a lot for your response.

> Hi,
> >
> > I am evaluating HTTP Async client and have following questions.
> >
> > How's IOReactorConfig.soTimeout different
> > from CoreConnectionPNames.SO_TIMEOUT? I am looking into the code but it's
> > not very obvious to me yet.
> IOReactorConfig applies to the lower level components (such as I/O
> session components) whereas CoreConnectionPNames apply to the protocol
> (HTTP level) components. CoreConnectionPNames and everything HttpParams
> related will be deprecated in the next series of releases (4.3), which,
> hopefully, should make HC configuration API more obvious and easier to
> use.

If this is the case, shouldn't the CoreConnectionPNames.SO_TIMEOUT value
eventually drive IOReactorConfig.soTimeout? What if they have different
values? While looking into the source, I didn't find a connection
between CoreConnectionPNames.SO_TIMEOUT and IOReactorConfig.soTimeout. From
my application point of view, which of these should I be setting? Which of
these values will eventually cause a SocketTimeoutException? I have tested
with CoreConnectionPNames.SO_TIMEOUT and it seems to be working. I haven't
tried IOReactorConfig.soTimeout yet. If CoreConnectionPNames.SO_TIMEOUT is
going to be deprecated, should I be using  IOReactorConfig.soTimeout?

> >  Also, what parameter should be taken into
> > account while setting value of IOReactorConfig.ioThreadCount? I see that
> > it's being defaulted to number of processors. But if my client
> application
> > is going to generate hundreds of simultaneous requests, should I be
> > changing this parameter?
> >
> No, you should not. You do not want to have any CPU cores underutilized.
> At the same time there is no point having more I/O selectors that the
> CPU cores capable of running them.

That makes sense. Say, I am on an 8 core machine (resulting in 8 threads)
and have an application that makes 100 simultaneous requests (let's assume
that it is always 100). Does it mean that at any given time only 8 requests
will be executed with the rest being queued? Does it makes sense for me to
increase the IOReactorConfig.ioThreadCount value? In response to one of my
other posts, you have pointed out PoolingClientAsyncConnectionManager that
should be used to control number of connections per address. I guess,
 defaultMaxPerRoute/maxPerRoute properties of this class will also play a
role in effective management of resources, right?

> In general, while using HTTP async client in high load environment, what
> > are the parameters that one needs to be aware of?
> >
> As usual, one needs to be careful with the connection pool settings. You
> probably do not want too many connections just sitting idle in the pool.
> At the same time you do not execution requests to pile up blocked by a
> limited number of available connections.
> Oleg
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message