camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-10240) CamelHttpClient default pool size does not work on system with large number of cpus
Date Sat, 03 Sep 2016 10:30:20 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-10240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15460852#comment-15460852
] 

Claus Ibsen commented on CAMEL-10240:
-------------------------------------

Ah there is already options on component for min/max thread pool size of http client

httpClientMinThreads
httpClientMaxThreads

which will be used when creating the http client, see JettyHttpComponent createHttpClient
method. 

Also jetty now uses 200 as max and 8 as min threads by default, in its default ctr for QueuedThreadPool.
We should likely remove that other code and leave those as default by jetty. Then end users
can configure the min/max client thread pool on the component to what they want to use.

> CamelHttpClient default pool size does not work on system with large number of cpus
> -----------------------------------------------------------------------------------
>
>                 Key: CAMEL-10240
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10240
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jetty
>    Affects Versions: 2.17.2
>            Reporter: Zoltan Farkas
>
> In CamelHttpClient a default threadpool is being created with a hardcoded size of 16:
> {code}
>     @Override
>     protected void doStart() throws Exception {
>         if (!hasThreadPool()) {
>             // if there is no thread pool then create a default thread pool using daemon
threads
>             QueuedThreadPool qtp = new QueuedThreadPool();
>             // 16 max threads is the default in the http client
>             qtp.setMaxThreads(16);
>             qtp.setDaemon(true);
>             // let the thread names indicate they are from the client
>             qtp.setName("CamelJettyClient(" + ObjectHelper.getIdentityHashCode(this)
+ ")");
>             setThreadPoolOrExecutor(qtp);
>         }
>         super.doStart();
>     }
> {code}
> this configuration does not work because number of selectors is calculated relative to
the number of CPUs in HttpClientTransportOverHTTP:
> {code}
>    public HttpClientTransportOverHTTP()
>     {
>         this(Math.max(1, Runtime.getRuntime().availableProcessors() / 2));
>     }
> {code}
> As a result by default camel simply hangs on these systems...
> It would be nice if CamelHttpClient would have a constructor that set the HttpClientTransport
or at least the number of selectors.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message