# Limit large number of threads

**URL:** <https://discuss.elastic.co/t/limit-large-number-of-threads/22775>\
**Category:** Elasticsearch\
**Created:** [March 20, 2015, 9:56am UTC](https://discuss.elastic.co/t/limit-large-number-of-threads/22775 "2015-03-20T09:56:38Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abid\_Hussain](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Abid\_Hussain](https://discuss.elastic.co/u/Abid_Hussain)\
**Post date:** [March 20, 2015, 9:56am UTC](https://discuss.elastic.co/t/limit-large-number-of-threads/22775/1 "2015-03-20T09:56:38Z")

</div>

Hi all,

I know I'm not the first one wondering about the number of threads but I  
didn't find anything really appropriate to my question.

We use ES with the default values for the thread pool sizes, that is  
actually (according to what bigdesk says):

- Search 72
- Index 24
- Bulk 24
- Refresh 10

This values sum up to 130. But in total, nearly 400 threads have been  
created by ES which makes a difference of about 280.

So I wonder which components are using the mentioned 280 threads?

And, is there is recommended way to limit extensive thread creation safely  
(i.e. without compromising cluster functionality)?

Regards,

Abid

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [March 20, 2015, 10:12am UTC](https://discuss.elastic.co/t/limit-large-number-of-threads/22775/2 "2015-03-20T10:12:00Z")

</div>

Hi,

please note that Bigdesk does not show all internal thread pools in ES now.

Regards,  
Lukas

On Fri, Mar 20, 2015 at 10:56 AM, Abid Hussain [hussain@novacom.mygbiz.com](mailto:hussain@novacom.mygbiz.com)  
wrote:

> Hi all,
> 
> I know I'm not the first one wondering about the number of threads but I  
> didn't find anything really appropriate to my question.
> 
> We use ES with the default values for the thread pool sizes, that is  
> actually (according to what bigdesk says):
> 
> - Search 72
> - Index 24
> - Bulk 24
> - Refresh 10
> 
> This values sum up to 130. But in total, nearly 400 threads have been  
> created by ES which makes a difference of about 280.
> 
> So I wonder which components are using the mentioned 280 threads?
> 
> And, is there is recommended way to limit extensive thread creation safely  
> (i.e. without compromising cluster functionality)?
> 
> Regards,
> 
> Abid
> 
> --  
> 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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAO9cvUbbvJBv%3DVnE1cOTRuGQFBEBJ9rYBETwO99NzJn3kKN%2BmA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAO9cvUbbvJBv%3DVnE1cOTRuGQFBEBJ9rYBETwO99NzJn3kKN%2BmA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Abid\_Hussain](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Abid\_Hussain](https://discuss.elastic.co/u/Abid_Hussain)\
**Post date:** [March 20, 2015, 1:08pm UTC](https://discuss.elastic.co/t/limit-large-number-of-threads/22775/3 "2015-03-20T13:08:37Z")

</div>

Thanks for clarification.

Still I wonder why such a huge amount of thread is created and if this can  
lead to issues - especially as it seems to me that they are never released.

Am Freitag, 20. März 2015 11:12:42 UTC+1 schrieb Lukáš Vlček:

> Hi,
> 
> please note that Bigdesk does not show all internal thread pools in ES now.
> 
> Regards,  
> Lukas
> 
> On Fri, Mar 20, 2015 at 10:56 AM, Abid Hussain \<[hus...@novacom.mygbiz.com](mailto:hus...@novacom.mygbiz.com)  
> \<javascript:\>\> wrote:
> 
> > Hi all,
> > 
> > I know I'm not the first one wondering about the number of threads but I  
> > didn't find anything really appropriate to my question.
> > 
> > We use ES with the default values for the thread pool sizes, that is  
> > actually (according to what bigdesk says):
> > 
> > - Search 72
> > - Index 24
> > - Bulk 24
> > - Refresh 10
> > 
> > This values sum up to 130. But in total, nearly 400 threads have been  
> > created by ES which makes a difference of about 280.
> > 
> > So I wonder which components are using the mentioned 280 threads?
> > 
> > And, is there is recommended way to limit extensive thread creation  
> > safely (i.e. without compromising cluster functionality)?
> > 
> > Regards,
> > 
> > Abid
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [March 20, 2015, 3:19pm UTC](https://discuss.elastic.co/t/limit-large-number-of-threads/22775/4 "2015-03-20T15:19:41Z")

</div>

If thread counts go out of bounds, it may be a lockup somewhere. What  
version of ES do you use?

Jörg

On Fri, Mar 20, 2015 at 2:08 PM, Abid Hussain [hussain@novacom.mygbiz.com](mailto:hussain@novacom.mygbiz.com)  
wrote:

> Thanks for clarification.
> 
> Still I wonder why such a huge amount of thread is created and if this can  
> lead to issues - especially as it seems to me that they are never released.
> 
> Am Freitag, 20. März 2015 11:12:42 UTC+1 schrieb Lukáš Vlček:
> 
> > Hi,
> > 
> > please note that Bigdesk does not show all internal thread pools in ES  
> > now.
> > 
> > Regards,  
> > Lukas
> > 
> > On Fri, Mar 20, 2015 at 10:56 AM, Abid Hussain \<[hus...@novacom.mygbiz.com](mailto:hus...@novacom.mygbiz.com)
> > 
> > > wrote:
> > 
> > > Hi all,
> > > 
> > > I know I'm not the first one wondering about the number of threads but I  
> > > didn't find anything really appropriate to my question.
> > > 
> > > We use ES with the default values for the thread pool sizes, that is  
> > > actually (according to what bigdesk says):
> > > 
> > > - Search 72
> > > - Index 24
> > > - Bulk 24
> > > - Refresh 10
> > > 
> > > This values sum up to 130. But in total, nearly 400 threads have been  
> > > created by ES which makes a difference of about 280.
> > > 
> > > So I wonder which components are using the mentioned 280 threads?
> > > 
> > > And, is there is recommended way to limit extensive thread creation  
> > > safely (i.e. without compromising cluster functionality)?
> > > 
> > > Regards,
> > > 
> > > Abid
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoF\_OoTYTK7WT1gWhcMkmvy3mqpWtVHZrp3-F8Voqhkahw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoF_OoTYTK7WT1gWhcMkmvy3mqpWtVHZrp3-F8Voqhkahw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 20, 2015, 3:30pm UTC](https://discuss.elastic.co/t/limit-large-number-of-threads/22775/5 "2015-03-20T15:30:01Z")

</div>

Each segment, each network connection and a whole bunch of other things  
will add to this.  
280 is a very low number and I wouldn't even worry about it.

On 20 March 2015 at 06:08, Abid Hussain [hussain@novacom.mygbiz.com](mailto:hussain@novacom.mygbiz.com) wrote:

> Thanks for clarification.
> 
> Still I wonder why such a huge amount of thread is created and if this can  
> lead to issues - especially as it seems to me that they are never released.
> 
> Am Freitag, 20. März 2015 11:12:42 UTC+1 schrieb Lukáš Vlček:
> 
> > Hi,
> > 
> > please note that Bigdesk does not show all internal thread pools in ES  
> > now.
> > 
> > Regards,  
> > Lukas
> > 
> > On Fri, Mar 20, 2015 at 10:56 AM, Abid Hussain \<[hus...@novacom.mygbiz.com](mailto:hus...@novacom.mygbiz.com)
> > 
> > > wrote:
> > 
> > > Hi all,
> > > 
> > > I know I'm not the first one wondering about the number of threads but I  
> > > didn't find anything really appropriate to my question.
> > > 
> > > We use ES with the default values for the thread pool sizes, that is  
> > > actually (according to what bigdesk says):
> > > 
> > > - Search 72
> > > - Index 24
> > > - Bulk 24
> > > - Refresh 10
> > > 
> > > This values sum up to 130. But in total, nearly 400 threads have been  
> > > created by ES which makes a difference of about 280.
> > > 
> > > So I wonder which components are using the mentioned 280 threads?
> > > 
> > > And, is there is recommended way to limit extensive thread creation  
> > > safely (i.e. without compromising cluster functionality)?
> > > 
> > > Regards,
> > > 
> > > Abid
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-uV%3DWf3VAzGuZL6rC\_7iQA6-%3DpXrn%2Bn5bT%2BFFuggrCJw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-uV%3DWf3VAzGuZL6rC_7iQA6-%3DpXrn%2Bn5bT%2BFFuggrCJw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Abid\_Hussain](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Abid\_Hussain](https://discuss.elastic.co/u/Abid_Hussain)\
**Post date:** [March 20, 2015, 3:41pm UTC](https://discuss.elastic.co/t/limit-large-number-of-threads/22775/6 "2015-03-20T15:41:30Z")

</div>

We're using 1.4.2 currently. Are there any issues known with this version?

If there is nothing to worry about 400 threads, it's ok for me. I just  
wonder why they never seem to be released.

Am Freitag, 20. März 2015 16:20:03 UTC+1 schrieb Jörg Prante:

> If thread counts go out of bounds, it may be a lockup somewhere. What  
> version of ES do you use?
> 
> Jörg
> 
> On Fri, Mar 20, 2015 at 2:08 PM, Abid Hussain \<[hus...@novacom.mygbiz.com](mailto:hus...@novacom.mygbiz.com)  
> \<javascript:\>\> wrote:
> 
> > Thanks for clarification.
> > 
> > Still I wonder why such a huge amount of thread is created and if this  
> > can lead to issues - especially as it seems to me that they are never  
> > released.
> > 
> > Am Freitag, 20. März 2015 11:12:42 UTC+1 schrieb Lukáš Vlček:
> > 
> > > Hi,
> > > 
> > > please note that Bigdesk does not show all internal thread pools in ES  
> > > now.
> > > 
> > > Regards,  
> > > Lukas
> > > 
> > > On Fri, Mar 20, 2015 at 10:56 AM, Abid Hussain \<  
> > > [hus...@novacom.mygbiz.com](mailto:hus...@novacom.mygbiz.com)\> wrote:
> > > 
> > > > Hi all,
> > > > 
> > > > I know I'm not the first one wondering about the number of threads but  
> > > > I didn't find anything really appropriate to my question.
> > > > 
> > > > We use ES with the default values for the thread pool sizes, that is  
> > > > actually (according to what bigdesk says):
> > > > 
> > > > - Search 72
> > > > - Index 24
> > > > - Bulk 24
> > > > - Refresh 10
> > > > 
> > > > This values sum up to 130. But in total, nearly 400 threads have been  
> > > > created by ES which makes a difference of about 280.
> > > > 
> > > > So I wonder which components are using the mentioned 280 threads?
> > > > 
> > > > And, is there is recommended way to limit extensive thread creation  
> > > > safely (i.e. without compromising cluster functionality)?
> > > > 
> > > > Regards,
> > > > 
> > > > Abid
> > > > 
> > > > --  
> > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e13d3eb5-f90d-45e3-ab24-901e1b0c284a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e13d3eb5-f90d-45e3-ab24-901e1b0c284a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [March 20, 2015, 3:41pm UTC](https://discuss.elastic.co/t/limit-large-number-of-threads/22775/7 "2015-03-20T15:41:34Z")

</div>

Hm, I doubt it is ok if a 1.4.0 node has 195 threads in state BLOCKED:

Thread 19374: (state = BLOCKED)

- sun.misc.Unsafe.park(boolean, long) @bci=0 (Compiled frame; information  
may be imprecise)
- java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=14,  
line=175 (Compiled frame)
- 

java.util.concurrent.LinkedTransferQueue.awaitMatch(java.util.concurrent.LinkedTransferQueue$Node,  
java.util.concurrent.LinkedTransferQueue$Node, java.lang.Object, boolean,  
long) @bci=184, line=737 (Compiled frame)

- java.util.concurrent.LinkedTransferQueue.xfer(java.lang.Object, boolean,  
int, long) @bci=286, line=647 (Compiled frame)
- java.util.concurrent.LinkedTransferQueue.take() @bci=5, line=1265  
(Compiled frame)
- org.elasticsearch.common.util.concurrent.SizeBlockingQueue.take()  
@bci=4, line=162 (Compiled frame)
- java.util.concurrent.ThreadPoolExecutor.getTask() @bci=149, line=1067  
(Compiled frame)
- 

java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker)  
@bci=26, line=1127 (Compiled frame)

- java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5, line=617  
(Compiled frame)
- java.lang.Thread.run() @bci=11, line=745 (Compiled frame)

Jörg

On Fri, Mar 20, 2015 at 4:30 PM, Mark Walkom [markwalkom@gmail.com](mailto:markwalkom@gmail.com) wrote:

> Each segment, each network connection and a whole bunch of other things  
> will add to this.  
> 280 is a very low number and I wouldn't even worry about it.
> 
> On 20 March 2015 at 06:08, Abid Hussain [hussain@novacom.mygbiz.com](mailto:hussain@novacom.mygbiz.com)  
> wrote:
> 
> > Thanks for clarification.
> > 
> > Still I wonder why such a huge amount of thread is created and if this  
> > can lead to issues - especially as it seems to me that they are never  
> > released.
> > 
> > Am Freitag, 20. März 2015 11:12:42 UTC+1 schrieb Lukáš Vlček:
> > 
> > > Hi,
> > > 
> > > please note that Bigdesk does not show all internal thread pools in ES  
> > > now.
> > > 
> > > Regards,  
> > > Lukas
> > > 
> > > On Fri, Mar 20, 2015 at 10:56 AM, Abid Hussain \<  
> > > [hus...@novacom.mygbiz.com](mailto:hus...@novacom.mygbiz.com)\> wrote:
> > > 
> > > > Hi all,
> > > > 
> > > > I know I'm not the first one wondering about the number of threads but  
> > > > I didn't find anything really appropriate to my question.
> > > > 
> > > > We use ES with the default values for the thread pool sizes, that is  
> > > > actually (according to what bigdesk says):
> > > > 
> > > > - Search 72
> > > > - Index 24
> > > > - Bulk 24
> > > > - Refresh 10
> > > > 
> > > > This values sum up to 130. But in total, nearly 400 threads have been  
> > > > created by ES which makes a difference of about 280.
> > > > 
> > > > So I wonder which components are using the mentioned 280 threads?
> > > > 
> > > > And, is there is recommended way to limit extensive thread creation  
> > > > safely (i.e. without compromising cluster functionality)?
> > > > 
> > > > Regards,
> > > > 
> > > > Abid
> > > > 
> > > > --  
> > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/cc37ef7c-0eac-4e1c-b084-dc1f26e8915d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > 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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/52a1c4dd-4edd-4395-b6f0-3d825a9dd424%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> 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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-uV%3DWf3VAzGuZL6rC\_7iQA6-%3DpXrn%2Bn5bT%2BFFuggrCJw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-uV%3DWf3VAzGuZL6rC_7iQA6-%3DpXrn%2Bn5bT%2BFFuggrCJw%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-uV%3DWf3VAzGuZL6rC\_7iQA6-%3DpXrn%2Bn5bT%2BFFuggrCJw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-uV%3DWf3VAzGuZL6rC_7iQA6-%3DpXrn%2Bn5bT%2BFFuggrCJw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoE4t%3DfgaE%3D9SW3dX08U5nUzpXLPi9T0iZsvbEwqfEKdHw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoE4t%3DfgaE%3D9SW3dX08U5nUzpXLPi9T0iZsvbEwqfEKdHw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [March 20, 2015, 3:47pm UTC](https://discuss.elastic.co/t/limit-large-number-of-threads/22775/8 "2015-03-20T15:47:22Z")

</div>

I think you should check a thread dump created by tools like jstack if you  
have a high JVM thread count in state BLOCKED. This might be a pointer that  
something unusual is going on, but I'm not sure.

Jörg

On Fri, Mar 20, 2015 at 4:41 PM, Abid Hussain [hussain@novacom.mygbiz.com](mailto:hussain@novacom.mygbiz.com)  
wrote:

> We're using 1.4.2 currently. Are there any issues known with this version?
> 
> If there is nothing to worry about 400 threads, it's ok for me. I just  
> wonder why they never seem to be released.

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFZaDaBTRw\_hY9%3DaJmrXCPqfO4i%2B4sOU1Svy1%2BJbHCJNg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFZaDaBTRw_hY9%3DaJmrXCPqfO4i%2B4sOU1Svy1%2BJbHCJNg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Abid\_Hussain](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Abid\_Hussain](https://discuss.elastic.co/u/Abid_Hussain)\
**Post date:** [March 23, 2015, 7:48am UTC](https://discuss.elastic.co/t/limit-large-number-of-threads/22775/9 "2015-03-23T07:48:15Z")

</div>

Thanks Jörg, I did a thread dump: 60 % of ~400 threads are in state  
WAITING, 35 % are in state RUNNABLE, the rest is in state TIMED\_WAITING,  
none is in state BLOCKED.

So I assume everything is OK - still wondering whats the point of creating  
hundreds of threads as there are "only" 24 cores available on our machine.

Best regards,

Abid

Am Freitag, 20. März 2015 16:47:28 UTC+1 schrieb Jörg Prante:

> I think you should check a thread dump created by tools like jstack if you  
> have a high JVM thread count in state BLOCKED. This might be a pointer that  
> something unusual is going on, but I'm not sure.
> 
> Jörg
> 
> >

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e0cef7f2-9f38-4c16-806d-45fbd3dc14a1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e0cef7f2-9f38-4c16-806d-45fbd3dc14a1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [March 23, 2015, 8:27am UTC](https://discuss.elastic.co/t/limit-large-number-of-threads/22775/10 "2015-03-23T08:27:11Z")

</div>

ES uses several threadpools. Some are fixed sized, some are scalable, and  
the reference is the JVM available core count, i.e.  
Runtime.getRuntime().availableProcessors(), which can be overridden by a  
"processors" directive:

> **[Thread pools | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-threadpool.html)**

I have 32 cores per machine so I'm also observing hundreds of idle threads.  
I do not use percolators/warmers/snapshot/suggest in my use case. Since  
they are not active, they steal a lot of my stack memory. Right now I don't  
care about idle threads but this can be a problem for small memory sized  
machines.

If you feel safe about reducing thread pool resources, you can decrease  
them in your config, e.g. -Des.processors=4. But you should monitor your  
performance, if you see bad numbers, go back to default.

Jörg

On Mon, Mar 23, 2015 at 8:48 AM, Abid Hussain [hussain@novacom.mygbiz.com](mailto:hussain@novacom.mygbiz.com)  
wrote:

> Thanks Jörg, I did a thread dump: 60 % of ~400 threads are in state  
> WAITING, 35 % are in state RUNNABLE, the rest is in state TIMED\_WAITING,  
> none is in state BLOCKED.
> 
> So I assume everything is OK - still wondering whats the point of creating  
> hundreds of threads as there are "only" 24 cores available on our machine.
> 
> Best regards,
> 
> Abid
> 
> Am Freitag, 20. März 2015 16:47:28 UTC+1 schrieb Jörg Prante:
> 
> > I think you should check a thread dump created by tools like jstack if  
> > you have a high JVM thread count in state BLOCKED. This might be a pointer  
> > that something unusual is going on, but I'm not sure.
> > 
> > Jörg
> > 
> > > --  
> > > 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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/e0cef7f2-9f38-4c16-806d-45fbd3dc14a1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e0cef7f2-9f38-4c16-806d-45fbd3dc14a1%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/e0cef7f2-9f38-4c16-806d-45fbd3dc14a1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e0cef7f2-9f38-4c16-806d-45fbd3dc14a1%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoF%2B2jrzPH6w%2BHa9v6ixJXOYS8Rdu\_%3DMdRc5PVDG6%3DK8-g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoF%2B2jrzPH6w%2BHa9v6ixJXOYS8Rdu_%3DMdRc5PVDG6%3DK8-g%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:24am UTC](https://discuss.elastic.co/t/limit-large-number-of-threads/22775/11 "2017-07-06T00:24:57Z")

</div>


