Limit number of thread in ThreadPool while creating TransportClient in elasticsearch

I'm creating a TransportClient instance in elasticsearch. Below is the code
for the same. The issue is I'm trying to lower the number of threads
spawned with the threadpool that TransportClient initiates.

public static TransportClient getTransportClient(String ip, int port) {

ImmutableSettings.Builder settings = ImmutableSettings
settings.put("", "elasticsearch");
settings.put("threadpool.bulk.type",  "fixed");
settings.put("threadpool.bulk.size" ,5);
settings.put("threadpool.bulk.queue_size", 5);
settings.put("threadpool.index.type" , "fixed");
settings.put("threadpool.index.size" , 5);
settings.put("threadpool.index.queue_size" , 10);
settings.put("",  "fixed");
settings.put("" ,5);
settings.put("", 5);;

TransportClient instance = new TransportClient(settings)
        .addTransportAddress(new InetSocketTransportAddress(ip, port));

return instance;


But what ever settings I use my elasticsearch always initialing the
threadpool with 12 threads. Guess that is the 4 time of CPU while
calculating the threadpool size.

Please let me know what is the configuration to get the desirable threads.


You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit