Java TransportClient: Number of threads

Hey there,

I'm using the Java TransportClient in my application and I've noticed that one instance of my application creates a lot of threads to communicate with Elasticsearch:
screenshot_threads_es2
I noticed that it creates twice as much transport_client_boss threads as there are CPUs.

This is a problem as we are running many instances of the application of the same server to connect to the same Elasticsearch node. We'd like to limit the number of threads.

I achived this by setting "processors" manually when creating the TransportClient:

Settings internalSettings = Settings.builder().put(..)
        .put("processors", 2)
        .build();
TransportClient client = new PreBuiltTransportClient(internalSettings);

I did this based on this recommendation: https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-threadpool.html#processors

The question now is: Are there any side effects? Do I need to adjust other settings as well? I could not find any documentation about it.

Thanks,
Jul

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.