# Huge number of 'elasticsearch\[cached\]-pool-1-thread-NNN' threads

**URL:** <https://discuss.elastic.co/t/huge-number-of-elasticsearch-cached-pool-1-thread-nnn-threads/4362>\
**Category:** Elasticsearch\
**Created:** [May 8, 2011, 6:53am UTC](https://discuss.elastic.co/t/huge-number-of-elasticsearch-cached-pool-1-thread-nnn-threads/4362 "2011-05-08T06:53:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jordansissel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jordansissel/32/44957_2.png) [@jordansissel](https://discuss.elastic.co/u/jordansissel)\
**Post date:** [May 8, 2011, 6:53am UTC](https://discuss.elastic.co/t/huge-number-of-elasticsearch-cached-pool-1-thread-nnn-threads/4362/1 "2011-05-08T06:53:28Z")

</div>

While helping someone debug a logstash issue tonight, we noticed that for an  
elasticsearch native java client had 1700 elasticsearch threads. After  
further digging, I concluded that the high thread count for elasticsearch,  
while abnormal, was not related to the problem I was debugging.

Emailing the list anyway to get some details about what is going on -

Here's a breakdown of elasticsearch threads according to jstack:

% grep '^"' logstash.jstack | fex '"1' | sed -re 's/[0-9]+/XXX/g' |sort|  
uniq -c | sort -n | grep elastic  
1 elasticsearch[Artemis]clusterService#updateTask-pool-XXX-thread-XXX  
1 elasticsearch[Artemis][scheduler]-pool-XXX-thread-XXX  
1 elasticsearch[Artemis][timer]  
1 elasticsearch[Artemis]transport\_client\_boss-pool-XXX-thread-XXX  
6 elasticsearch[Artemis]transport\_client\_worker-pool-XXX-thread-XXX  
1694 elasticsearch[cached]-pool-XXX-thread-XXX

What are these 'cached' pool threads? Why would there be almost 1700 of  
them?

Are they pending queries? Something else?

-Jordan

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 8, 2011, 6:56am UTC](https://discuss.elastic.co/t/huge-number-of-elasticsearch-cached-pool-1-thread-nnn-threads/4362/2 "2011-05-08T06:56:13Z")

</div>

Which version of elasticsearch are you using? The thread pool names changed between versions.  
On Sunday, May 8, 2011 at 9:53 AM, Jordan Sissel wrote:

> While helping someone debug a logstash issue tonight, we noticed that for an elasticsearch native java client had 1700 elasticsearch threads. After further digging, I concluded that the high thread count for elasticsearch, while abnormal, was not related to the problem I was debugging.
> 
> Emailing the list anyway to get some details about what is going on -
> 
> Here's a breakdown of elasticsearch threads according to jstack:
> 
> % grep '^"' logstash.jstack | fex '"1' | sed -re 's/[0-9]+/XXX/g' |sort| uniq -c | sort -n | grep elastic  
> 1 elasticsearch[Artemis]clusterService#updateTask-pool-XXX-thread-XXX  
> 1 elasticsearch[Artemis][scheduler]-pool-XXX-thread-XXX  
> 1 elasticsearch[Artemis][timer]  
> 1 elasticsearch[Artemis]transport\_client\_boss-pool-XXX-thread-XXX  
> 6 elasticsearch[Artemis]transport\_client\_worker-pool-XXX-thread-XXX  
> 1694 elasticsearch[cached]-pool-XXX-thread-XXX
> 
> What are these 'cached' pool threads? Why would there be almost 1700 of them?
> 
> Are they pending queries? Something else?
> 
> -Jordan

---

<div class="post-metadata">

**Author:** ![jordansissel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jordansissel/32/44957_2.png) [@jordansissel](https://discuss.elastic.co/u/jordansissel)\
**Post date:** [May 9, 2011, 12:29am UTC](https://discuss.elastic.co/t/huge-number-of-elasticsearch-cached-pool-1-thread-nnn-threads/4362/3 "2011-05-09T00:29:21Z")

</div>

On Sat, May 7, 2011 at 11:56 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Which version of elasticsearch are you using? The thread pool names  
> changed between versions.

The client I shipped should be version 0.16.0

-Jordan

On Sunday, May 8, 2011 at 9:53 AM, Jordan Sissel wrote:

> While helping someone debug a logstash issue tonight, we noticed that for  
> an elasticsearch native java client had 1700 elasticsearch threads. After  
> further digging, I concluded that the high thread count for elasticsearch,  
> while abnormal, was not related to the problem I was debugging.
> 
> Emailing the list anyway to get some details about what is going on -
> 
> Here's a breakdown of elasticsearch threads according to jstack:
> 
> % grep '^"' logstash.jstack | fex '"1' | sed -re 's/[0-9]+/XXX/g' |sort|  
> uniq -c | sort -n | grep elastic  
> 1 elasticsearch[Artemis]clusterService#updateTask-pool-XXX-thread-XXX  
> 1 elasticsearch[Artemis][scheduler]-pool-XXX-thread-XXX  
> 1 elasticsearch[Artemis][timer]  
> 1 elasticsearch[Artemis]transport\_client\_boss-pool-XXX-thread-XXX  
> 6 elasticsearch[Artemis]transport\_client\_worker-pool-XXX-thread-XXX  
> 1694 elasticsearch[cached]-pool-XXX-thread-XXX
> 
> What are these 'cached' pool threads? Why would there be almost 1700 of  
> them?
> 
> Are they pending queries? Something else?
> 
> -Jordan

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 9, 2011, 8:48am UTC](https://discuss.elastic.co/t/huge-number-of-elasticsearch-cached-pool-1-thread-nnn-threads/4362/4 "2011-05-09T08:48:41Z")

</div>

Then thats strange, I would expect to see other elasticsearch threads in this case. Which client are you using in this case, the NodeClient or the TransportClient?  
On Monday, May 9, 2011 at 3:29 AM, Jordan Sissel wrote:

> On Sat, May 7, 2011 at 11:56 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> > Which version of elasticsearch are you using? The thread pool names changed between versions.
> 
> The client I shipped should be version 0.16.0
> 
> -Jordan
> 
> > On Sunday, May 8, 2011 at 9:53 AM, Jordan Sissel wrote:
> > 
> > > While helping someone debug a logstash issue tonight, we noticed that for an elasticsearch native java client had 1700 elasticsearch threads. After further digging, I concluded that the high thread count for elasticsearch, while abnormal, was not related to the problem I was debugging.
> > > 
> > > Emailing the list anyway to get some details about what is going on -
> > > 
> > > Here's a breakdown of elasticsearch threads according to jstack:
> > > 
> > > % grep '^"' logstash.jstack | fex '"1' | sed -re 's/[0-9]+/XXX/g' |sort| uniq -c | sort -n | grep elastic  
> > > 1 elasticsearch[Artemis]clusterService#updateTask-pool-XXX-thread-XXX  
> > > 1 elasticsearch[Artemis][scheduler]-pool-XXX-thread-XXX  
> > > 1 elasticsearch[Artemis][timer]  
> > > 1 elasticsearch[Artemis]transport\_client\_boss-pool-XXX-thread-XXX  
> > > 6 elasticsearch[Artemis]transport\_client\_worker-pool-XXX-thread-XXX  
> > > 1694 elasticsearch[cached]-pool-XXX-thread-XXX
> > > 
> > > What are these 'cached' pool threads? Why would there be almost 1700 of them?
> > > 
> > > Are they pending queries? Something else?
> > > 
> > > -Jordan

---

<div class="post-metadata">

**Author:** ![jordansissel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jordansissel/32/44957_2.png) [@jordansissel](https://discuss.elastic.co/u/jordansissel)\
**Post date:** [May 9, 2011, 8:11pm UTC](https://discuss.elastic.co/t/huge-number-of-elasticsearch-cached-pool-1-thread-nnn-threads/4362/5 "2011-05-09T20:11:12Z")

</div>

On Mon, May 9, 2011 at 1:48 AM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Then thats strange, I would expect to see other elasticsearch threads in  
> this case. Which client are you using in this case, the NodeClient or the  
> TransportClient?

I believe the 'node' client? Though I don't know for sure, here's the code  
that creates it:

org.elasticsearch.node.NodeBuilder.nodeBuilder.client(true).node.client

-Jordan

On Monday, May 9, 2011 at 3:29 AM, Jordan Sissel wrote:

> On Sat, May 7, 2011 at 11:56 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> 
> Which version of elasticsearch are you using? The thread pool names  
> changed between versions.
> 
> The client I shipped should be version 0.16.0
> 
> -Jordan
> 
> On Sunday, May 8, 2011 at 9:53 AM, Jordan Sissel wrote:
> 
> While helping someone debug a logstash issue tonight, we noticed that for  
> an elasticsearch native java client had 1700 elasticsearch threads. After  
> further digging, I concluded that the high thread count for elasticsearch,  
> while abnormal, was not related to the problem I was debugging.
> 
> Emailing the list anyway to get some details about what is going on -
> 
> Here's a breakdown of elasticsearch threads according to jstack:
> 
> % grep '^"' logstash.jstack | fex '"1' | sed -re 's/[0-9]+/XXX/g' |sort|  
> uniq -c | sort -n | grep elastic  
> 1 elasticsearch[Artemis]clusterService#updateTask-pool-XXX-thread-XXX  
> 1 elasticsearch[Artemis][scheduler]-pool-XXX-thread-XXX  
> 1 elasticsearch[Artemis][timer]  
> 1 elasticsearch[Artemis]transport\_client\_boss-pool-XXX-thread-XXX  
> 6 elasticsearch[Artemis]transport\_client\_worker-pool-XXX-thread-XXX  
> 1694 elasticsearch[cached]-pool-XXX-thread-XXX
> 
> What are these 'cached' pool threads? Why would there be almost 1700 of  
> them?
> 
> Are they pending queries? Something else?
> 
> -Jordan

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 10, 2011, 9:11pm UTC](https://discuss.elastic.co/t/huge-number-of-elasticsearch-cached-pool-1-thread-nnn-threads/4362/6 "2011-05-10T21:11:25Z")

</div>

Yea, thats the node client. strange... . I will try and run some tests to see if I can repro, if you can do the same, it would be great...  
On Monday, May 9, 2011 at 11:11 PM, Jordan Sissel wrote:

> On Mon, May 9, 2011 at 1:48 AM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> > Then thats strange, I would expect to see other elasticsearch threads in this case. Which client are you using in this case, the NodeClient or the TransportClient?
> 
> I believe the 'node' client? Though I don't know for sure, here's the code that creates it:
> 
> org.elasticsearch.node.NodeBuilder.nodeBuilder.client(true).node.client
> 
> -Jordan
> 
> > On Monday, May 9, 2011 at 3:29 AM, Jordan Sissel wrote:
> > 
> > > On Sat, May 7, 2011 at 11:56 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> > > 
> > > > Which version of elasticsearch are you using? The thread pool names changed between versions.
> > > 
> > > The client I shipped should be version 0.16.0
> > > 
> > > -Jordan
> > > 
> > > > On Sunday, May 8, 2011 at 9:53 AM, Jordan Sissel wrote:
> > > > 
> > > > > While helping someone debug a logstash issue tonight, we noticed that for an elasticsearch native java client had 1700 elasticsearch threads. After further digging, I concluded that the high thread count for elasticsearch, while abnormal, was not related to the problem I was debugging.
> > > > > 
> > > > > Emailing the list anyway to get some details about what is going on -
> > > > > 
> > > > > Here's a breakdown of elasticsearch threads according to jstack:
> > > > > 
> > > > > % grep '^"' logstash.jstack | fex '"1' | sed -re 's/[0-9]+/XXX/g' |sort| uniq -c | sort -n | grep elastic  
> > > > > 1 elasticsearch[Artemis]clusterService#updateTask-pool-XXX-thread-XXX  
> > > > > 1 elasticsearch[Artemis][scheduler]-pool-XXX-thread-XXX  
> > > > > 1 elasticsearch[Artemis][timer]  
> > > > > 1 elasticsearch[Artemis]transport\_client\_boss-pool-XXX-thread-XXX  
> > > > > 6 elasticsearch[Artemis]transport\_client\_worker-pool-XXX-thread-XXX  
> > > > > 1694 elasticsearch[cached]-pool-XXX-thread-XXX
> > > > > 
> > > > > What are these 'cached' pool threads? Why would there be almost 1700 of them?
> > > > > 
> > > > > Are they pending queries? Something else?
> > > > > 
> > > > > -Jordan

---

<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, 4:06am UTC](https://discuss.elastic.co/t/huge-number-of-elasticsearch-cached-pool-1-thread-nnn-threads/4362/7 "2017-07-06T04:06:32Z")

</div>


