ElasticSearch Thread Pools

saurav omar
1 min readJun 9, 2020

--

When dealing with a large number of parallel operations in elastic search, such as search requests or bulk indexing operations, Elasticsearch uses Threadpools to manage the processing of incoming requests and to optimize the use of resources on each node in the cluster.

What is Thread pools:

  • Thread pools are a collection of threads that are available to perform tasks.
  • It helps us to manage memory management in the case. of executing a large number of requests.
  • Elastic Search has different thread pools for different purposes like Searching, Indexing.
  • It also has Queue, when all the threads busy. executing then-incoming requests gets queued for execution.

you can check different types thread pool using below command

curl -XGET localhost:9200/_cat/thread_pool?v&h=node_name,name,active,rejected,completed?v

There are many thread pools are present in Elastic Search, we mainly look some of them.

Search ActiveThread pools:

  • In elasticsearch it has a dedicated search pool and an associated queue for each node.
  • There are a number of workers which are equal to no of cores present in those machines.
  • By default Search thread pool size is based on Littles’law.
 ((available_processors * 3) / 2) + 1
  • We can also update thread pool size using property in elasticsearch.yml
threadpool.search.size
  • Default queue_size of 1000.

Write or Index ActiveThread pools:

  • In elasticsearch it has a dedicated index the pool and an associated queue for each node.
  • By default Index thread pool size is based on Littles’law.
(1 + available processors)
  • We can also update thread pool size using property in elasticsearch.yml
threadpool.index.size:
  • Default queue_size of 200.

Thanks

Happy Learning!!

--

--