# Bulk Threadpool # of thread not changing

**URL:** <https://discuss.elastic.co/t/bulk-threadpool-of-thread-not-changing/52762>\
**Category:** Elasticsearch\
**Created:** [June 14, 2016, 5:01pm UTC](https://discuss.elastic.co/t/bulk-threadpool-of-thread-not-changing/52762 "2016-06-14T17:01:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anks](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@anks](https://discuss.elastic.co/u/anks)\
**Post date:** [June 14, 2016, 5:01pm UTC](https://discuss.elastic.co/t/bulk-threadpool-of-thread-not-changing/52762/1 "2016-06-14T17:01:51Z")

</div>

Hi All,

I am setting high number of thread by threadpool.bulk.size: 160 in elasticsearch.yml

But when I am getting maximum 4 threads.

I am using 4 core CPU.

What can be the issue ?

Thanks!

---

<div class="post-metadata">

**Author:** ![msimos](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@msimos](https://discuss.elastic.co/u/msimos)\
**Post date:** [June 14, 2016, 8:32pm UTC](https://discuss.elastic.co/t/bulk-threadpool-of-thread-not-changing/52762/2 "2016-06-14T20:32:56Z")

</div>

What version are you using? You can't no longer set threadpool.bulk.size more then the number of processors/cores:

> <https://github.com/elastic/elasticsearch/pull/15585>

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [June 15, 2016, 1:10am UTC](https://discuss.elastic.co/t/bulk-threadpool-of-thread-not-changing/52762/3 "2016-06-15T01:10:18Z")

</div>

It doesn't make any sense to set the number of threads that high. If they are all scheduable then they'll just starve each other of CPU time, and you'll get worse performance than if you had set it lower (from all the context switching). As @msimos pointed out, starting in 2.1.2 and 2.2.0 of Elasticsearch, it will not be possible to set the number of threads in the bulk and indexing pools to more than the number of cores; Elasticsearch will warn you that this is bad and truncate the value to the number of cores. Starting in Elasticsearch 5.0.0, we will relax this slightly to allow one plus the number of cores (so another thread is available if one is blocked on I/O) but Elasticsearch will hard fail at startup if you try to set it higher.

---

<div class="post-metadata">

**Author:** ![anks](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@anks](https://discuss.elastic.co/u/anks)\
**Post date:** [June 15, 2016, 5:34am UTC](https://discuss.elastic.co/t/bulk-threadpool-of-thread-not-changing/52762/4 "2016-06-15T05:34:37Z")

</div>

Cool.

That's useful information.

Thanks!

---

<div class="post-metadata">

**Author:** ![anks](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@anks](https://discuss.elastic.co/u/anks)\
**Post date:** [June 15, 2016, 7:25pm UTC](https://discuss.elastic.co/t/bulk-threadpool-of-thread-not-changing/52762/5 "2016-06-15T19:25:36Z")

</div>

One follow up query.

If we add more machine will that add to bulk thread capacity. So suppose I add one more machine with 4 processor now total two nodes in cluster. Will my bulk thread become 8 or still remain 4 ?

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [June 15, 2016, 9:40pm UTC](https://discuss.elastic.co/t/bulk-threadpool-of-thread-not-changing/52762/6 "2016-06-15T21:40:26Z")

</div>

Thread pool settings apply per Java VM. No matter how many nodes you run, you don't have to adjust the thread pool settings. As a side note, you should run one Java VM per machine.

---

<div class="post-metadata">

**Author:** ![anks](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@anks](https://discuss.elastic.co/u/anks)\
**Post date:** [June 16, 2016, 4:31am UTC](https://discuss.elastic.co/t/bulk-threadpool-of-thread-not-changing/52762/7 "2016-06-16T04:31:23Z")

</div>

Hi @jprante

I am not running multiple jvm on single machine.

I am asking if I add one more node to server ( separate server/machine) . So it will be 2 separate servers and separate JVM.

In this case will the bulk thread capacity doubled ?

---

<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:** [July 5, 2017, 10:43pm UTC](https://discuss.elastic.co/t/bulk-threadpool-of-thread-not-changing/52762/8 "2017-07-05T22:43:29Z")

</div>


