# Index threadpool vs write threadpool

**URL:** https://discuss.elastic.co/t/index-threadpool-vs-write-threadpool/151864
**Category:** Elasticsearch
**Created:** [October 10, 2018, 2:30pm UTC](https://discuss.elastic.co/t/index-threadpool-vs-write-threadpool/151864 "2018-10-10T14:30:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bli](https://avatars.discourse-cdn.com/v4/letter/b/ea5d25/32.png) [@bli](https://discuss.elastic.co/u/bli)
#### Post date: [October 10, 2018, 2:30pm UTC](https://discuss.elastic.co/t/index-threadpool-vs-write-threadpool/151864/1 "2018-10-10T14:30:48Z")

</div>

According to [https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-threadpool.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-threadpool.html), a node holds:

index threadpool  
For index/delete operations. Thread pool type is `fixed` with a size of `# of available processors` , queue\_size of `200` . The maximum size for this pool is `1 + # of available processors` .

write threadpool  
For single-document index/delete/update and bulk requests. Thread pool type is `fixed` with a size of `# of available processors` , queue\_size of `200` . The maximum size for this pool is `1 + # of available processors` .

Anyone can explain what's the difference?

---

<div class="post-metadata">

### Author: ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)
#### Post date: [October 10, 2018, 4:10pm UTC](https://discuss.elastic.co/t/index-threadpool-vs-write-threadpool/151864/2 "2018-10-10T16:10:29Z")

</div>

Hi Bli,

In 6.x the `WRITE` threadpool is used for _shard-level_ bulk and resync replication operations. The `INDEX` threadpool is used for other update, delete, and indexing operations.

---

<div class="post-metadata">

### Author: ![bli](https://avatars.discourse-cdn.com/v4/letter/b/ea5d25/32.png) [@bli](https://discuss.elastic.co/u/bli)
#### Post date: [October 10, 2018, 4:33pm UTC](https://discuss.elastic.co/t/index-threadpool-vs-write-threadpool/151864/3 "2018-10-10T16:33:36Z")

</div>

Thank you @dakrone.

We use bulk API to write to ES. That worked perfect for certain types of data with large volume and high throughput is desired (e.g. metrics). For other types of data (e.g. inventory), we want them to be searchable near real-time. Since for now all our data use the same bulk API, they end up with competing resource and as result sometimes inventory data will not be indexed as quick as we'd like.

One way i'm looking to is use index API for inventory data, and bulk API for other types of data. This way they are handled by different threadpool, and likely less competing. Do you think it would work?

However looking as ES source code in master, it looks like index threadpool is deprecated? Then the above solution might work in 6.3, it won't work in the future.

Really appreciate your help!

---

<div class="post-metadata">

### Author: ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)
#### Post date: [October 10, 2018, 4:50pm UTC](https://discuss.elastic.co/t/index-threadpool-vs-write-threadpool/151864/4 "2018-10-10T16:50:27Z")

</div>

Hi Bli,

> One way i'm looking to is use index API for inventory data, and bulk API for other types of data. This way they are handled by different threadpool, and likely less competing. Do you think it would work?

In order to do this you would have to write a plugin that changed these APIs, instead I'd recommend sticking with the vanilla threadpooling of ES.

> However looking as ES source code in master, it looks like index threadpool is deprecated? Then the above solution might work in 6.3, it won't work in the future.

That's correct, in 7.0 there is only the `WRITE` threadpool, so I would not count on this.

---

<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: [November 7, 2018, 4:50pm UTC](https://discuss.elastic.co/t/index-threadpool-vs-write-threadpool/151864/5 "2018-11-07T16:50:28Z")

</div>

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