# Node stats question - threads and active

**URL:** <https://discuss.elastic.co/t/node-stats-question-threads-and-active/9687>\
**Category:** Elasticsearch\
**Created:** [November 13, 2012, 12:42am UTC](https://discuss.elastic.co/t/node-stats-question-threads-and-active/9687 "2012-11-13T00:42:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arta](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@arta](https://discuss.elastic.co/u/arta)\
**Post date:** [November 13, 2012, 12:42am UTC](https://discuss.elastic.co/t/node-stats-question-threads-and-active/9687/1 "2012-11-13T00:42:31Z")

</div>

Hi,  
I recently changed thread\_pool type of "bulk" from the "cached" (default) to "blocking".  
This was because I observed very high number of threads (about 20,000) and often times it ended up with losing the node. (by slow response of the node).  
I thought the number of thread itself was choking the system, so I'm trying the blocking type.  
Since changing it to the blocking, the system is stable. (so far. I changed it only a couple of days ago.)

By the way, the question here is about node stats.  
The curl localhost:9200/\_cluster/nodes//stats?thread\_pool=true gives us  
"threads", "queue", "active" for each thread pool.  
I understand "queue" is the number of tasks waiting in the thread pool queue.  
What I don't understand is "threads" and "active".  
My assumption is "thread" is the number of threads created in the thread pool and "active" is the number of thread which is currently running.  
Is this correct?  
It seems "threads" is simply growing. Does it decrease some time later in some condition?

Are there difference by the type of the thread pool?  
I can imagine "queue" has nothing to do with "cached", "threads" do not change with "fixed".  
So the meaningful measure for "cached" is "threads" (or "active"?) and for "fixed" is "queue" and "active"?

I'm trying to monitor the node's 'busyness' by monitoring the thread\_pool in node stats.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [November 13, 2012, 3:22am UTC](https://discuss.elastic.co/t/node-stats-question-threads-and-active/9687/2 "2012-11-13T03:22:32Z")

</div>

Your assumptions about threads and active are correct. The threads is the  
number of current threads in the pool and active is approximate number of  
threads that are actively executing tasks. The number of threads in the  
pool should drop down to the minimum number of threads (specified by min  
parameter and defaults to 1) after a period of inactivity (specified by  
keep\_alive parameter and defaults to 5min). You can find more information  
about different types of threads  
here: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/modules/threadpool.html)

On Monday, November 12, 2012 7:42:38 PM UTC-5, arta wrote:

> Hi,  
> I recently changed thread\_pool type of "bulk" from the "cached" (default)  
> to  
> "blocking".  
> This was because I observed very high number of threads (about 20,000) and  
> often times it ended up with losing the node. (by slow response of the  
> node).  
> I thought the number of thread itself was choking the system, so I'm  
> trying  
> the blocking type.  
> Since changing it to the blocking, the system is stable. (so far. I  
> changed  
> it only a couple of days ago.)
> 
> By the way, the question here is about node stats.  
> The curl localhost:9200/\_cluster/nodes//stats?thread\_pool=true  
> gives us  
> "threads", "queue", "active" for each thread pool.  
> I understand "queue" is the number of tasks waiting in the thread pool  
> queue.  
> What I don't understand is "threads" and "active".  
> My assumption is "thread" is the number of threads created in the thread  
> pool and "active" is the number of thread which is currently running.  
> Is this correct?  
> It seems "threads" is simply growing. Does it decrease some time later in  
> some condition?
> 
> Are there difference by the type of the thread pool?  
> I can imagine "queue" has nothing to do with "cached", "threads" do not  
> change with "fixed".  
> So the meaningful measure for "cached" is "threads" (or "active"?) and for  
> "fixed" is "queue" and "active"?
> 
> I'm trying to monitor the node's 'busyness' by monitoring the thread\_pool  
> in  
> node stats.
> 
> Thanks for your help.
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Node-stats-question-threads-and-active-tp4025348.html](http://elasticsearch-users.115913.n3.nabble.com/Node-stats-question-threads-and-active-tp4025348.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--

---

<div class="post-metadata">

**Author:** ![arta](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@arta](https://discuss.elastic.co/u/arta)\
**Post date:** [November 13, 2012, 7:33pm UTC](https://discuss.elastic.co/t/node-stats-question-threads-and-active/9687/3 "2012-11-13T19:33:48Z")

</div>

Thank you Igor,  
I'll be monitoring "active" for both "cached" and "blocking" thread pools, then.  
(I don't have "fixed" thread pool).  
Thanks again.

---

<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, 3:04am UTC](https://discuss.elastic.co/t/node-stats-question-threads-and-active/9687/4 "2017-07-06T03:04:31Z")

</div>


