# How to check number of threads used for indexing in Elasticsearch?

**URL:** <https://discuss.elastic.co/t/how-to-check-number-of-threads-used-for-indexing-in-elasticsearch/174513>\
**Category:** Elasticsearch\
**Created:** [March 29, 2019, 10:11am UTC](https://discuss.elastic.co/t/how-to-check-number-of-threads-used-for-indexing-in-elasticsearch/174513 "2019-03-29T10:11:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![suvarna](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@suvarna](https://discuss.elastic.co/u/suvarna)\
**Post date:** [March 29, 2019, 10:11am UTC](https://discuss.elastic.co/t/how-to-check-number-of-threads-used-for-indexing-in-elasticsearch/174513/1 "2019-03-29T10:11:51Z")

</div>

Hi

My system having 28 cores and 112 cpus.

How to check the number of threads used for indexing in Elasticsearch to enable the parallelism.

How to check the number of threads used for merging in Elaticsearch.

Please let me know the same.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 29, 2019, 10:32am UTC](https://discuss.elastic.co/t/how-to-check-number-of-threads-used-for-indexing-in-elasticsearch/174513/2 "2019-03-29T10:32:52Z")

</div>

You can see statistics about thread usage in the [nodes stats API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html). For instance, this will tell you how many `write` threads there are on each node:

```auto
GET /_nodes/stats?filter_path=nodes.*.thread_pool.write.threads

```

I do not think these stats include merge threads, because these do not belong to a thread pool. There is a [setting to limit the maximum number of merge threads](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-merge.html#merge-scheduling).

---

<div class="post-metadata">

**Author:** ![suvarna](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@suvarna](https://discuss.elastic.co/u/suvarna)\
**Post date:** [March 29, 2019, 11:32am UTC](https://discuss.elastic.co/t/how-to-check-number-of-threads-used-for-indexing-in-elasticsearch/174513/3 "2019-03-29T11:32:50Z")

</div>

Thanks for info.

curl -X GET "localhost:9200/\_nodes/stats?filter\_path=nodes.\*.thread\_pool.write.threads"

This gives me result as  
{"nodes":{"knlA8wEDRq26cpfcQgh\_6Q":{"thread\_pool":{"write":{"threads":112}}}}}

Is there any possibility to increase the thread\_pool with write threads more than 112 to increase the performance. (If yes what is the parameter )

Can you please let me know where to configure the "index.merge.scheduler.max\_thread\_count" (is it in elasicsearch.yml?)

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 29, 2019, 2:51pm UTC](https://discuss.elastic.co/t/how-to-check-number-of-threads-used-for-indexing-in-elasticsearch/174513/4 "2019-03-29T14:51:47Z")

</div>

> [@suvarna](#):
>
> Is there any possibility to increase the thread\_pool with write threads more than 112 to increase the performance. (If yes what is the parameter )

You can [increase it to 113](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-threadpool.html) but I doubt it'll help.

> [@suvarna](#):
>
> Can you please let me know where to configure the "index.merge.scheduler.max\_thread\_count" (is it in elasicsearch.yml?)

This is a per-index setting so you set it when creating the index or through the [update indices settings API](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html). Again I doubt it'll help, and it might even make things worse.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 26, 2019, 2:51pm UTC](https://discuss.elastic.co/t/how-to-check-number-of-threads-used-for-indexing-in-elasticsearch/174513/5 "2019-04-26T14:51:50Z")

</div>

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