You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Zoltan Farkas (JIRA)" <ji...@apache.org> on 2016/08/11 20:22:20 UTC

[jira] [Created] (CAMEL-10240) CamelHttpClient default pool size does not work on system with large number of cpus

Zoltan Farkas created CAMEL-10240:
-------------------------------------

             Summary: 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: Bug
          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...



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