# Concurrent Indices stats requests cause cluster to go red

**URL:** <https://discuss.elastic.co/t/concurrent-indices-stats-requests-cause-cluster-to-go-red/161385>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring\
**Created:** [December 18, 2018, 5:22pm UTC](https://discuss.elastic.co/t/concurrent-indices-stats-requests-cause-cluster-to-go-red/161385 "2018-12-18T17:22:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnskopis](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@johnskopis](https://discuss.elastic.co/u/johnskopis)\
**Post date:** [December 18, 2018, 5:22pm UTC](https://discuss.elastic.co/t/concurrent-indices-stats-requests-cause-cluster-to-go-red/161385/1 "2018-12-18T17:22:06Z")

</div>

We use the elasticsearch-prometheus-exporter plugin. Occasionally it seems the cluster status turns red from making index stats requests via prometheus-exporter plugin.

has anyone else experienced this issue?

I obtained a threaddump when the cluster was red and saw this:

> <https://gist.github.com/johnskopis/bb3012a42f2b56304cc31d2861b6bfe0>

seems like the issue is the management threadpool is doing too much work. Does this sound right?

---

<div class="post-metadata">

**Author:** ![johnskopis](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@johnskopis](https://discuss.elastic.co/u/johnskopis)\
**Post date:** [December 18, 2018, 5:22pm UTC](https://discuss.elastic.co/t/concurrent-indices-stats-requests-cause-cluster-to-go-red/161385/2 "2018-12-18T17:22:53Z")

</div>

I should add I tried to open a bug here: [https://github.com/elastic/elasticsearch/issues/36773](https://github.com/elastic/elasticsearch/issues/36773)

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [December 18, 2018, 6:06pm UTC](https://discuss.elastic.co/t/concurrent-indices-stats-requests-cause-cluster-to-go-red/161385/3 "2018-12-18T18:06:45Z")

</div>

How often are you requesting indices stats? The completion stats in particular look nontrivial to calculate, and [are not even mentioned in the list of stats in your plugin's README](https://github.com/justwatchcom/elasticsearch_exporter) so maybe you can simply avoid asking for them. The [indices stats API](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html) supports requesting subsets of stats.

The plugin's readme also says this:

> **NOTE:** The exporter fetches information from an Elasticsearch cluster on every scrape, therefore having a too short scrape interval can impose load on ES master nodes, particularly if you run with `-es.all` and `-es.indices` . We suggest you measure how long fetching `/_nodes/stats` and `/_all/_stats` takes for your ES cluster to determine whether your scraping interval is too short. As a last resort, you can scrape this exporter using a dedicated job with its own scraping interval.

This seems like wise advice.

---

<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:** [January 15, 2019, 6:06pm UTC](https://discuss.elastic.co/t/concurrent-indices-stats-requests-cause-cluster-to-go-red/161385/4 "2019-01-15T18:06:45Z")

</div>

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