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:
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)
TransportClient client = new PreBuiltTransportClient(internalSettings);

I did this based on this recommendation:

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.


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