# Node local stats slow 3 nodes cluster

**URL:** <https://discuss.elastic.co/t/node-local-stats-slow-3-nodes-cluster/54800>\
**Category:** Elasticsearch\
**Created:** [July 6, 2016, 6:15am UTC](https://discuss.elastic.co/t/node-local-stats-slow-3-nodes-cluster/54800 "2016-07-06T06:15:49Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![panda87](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@panda87](https://discuss.elastic.co/u/panda87)\
**Post date:** [July 6, 2016, 6:15am UTC](https://discuss.elastic.co/t/node-local-stats-slow-3-nodes-cluster/54800/1 "2016-07-06T06:15:49Z")

</div>

Lately I noticed that /\_nodes/\_local/stats command taking my cluster nodes more than 4s to retrieve stats and the cluster seems to be ok. cpu \ load 30% and heap 60-65% avg.

Can you think about reason of why this happen?

In addition, there is anyway to get these stats faster?

Thanks  
D.

---

<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:** [July 6, 2016, 6:17am UTC](https://discuss.elastic.co/t/node-local-stats-slow-3-nodes-cluster/54800/2 "2016-07-06T06:17:15Z")

</div>

What version are you on? What OS, JVM?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 6, 2016, 6:17am UTC](https://discuss.elastic.co/t/node-local-stats-slow-3-nodes-cluster/54800/3 "2016-07-06T06:17:55Z")

</div>

How many indexes and shards does the cluster contain?

---

<div class="post-metadata">

**Author:** ![panda87](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@panda87](https://discuss.elastic.co/u/panda87)\
**Post date:** [July 6, 2016, 6:42am UTC](https://discuss.elastic.co/t/node-local-stats-slow-3-nodes-cluster/54800/4 "2016-07-06T06:42:54Z")

</div>

ES version 2.1.1  
Ubuntu 14.04  
java version "1.8.0\_72"  
3,725 indices  
17,525 shards

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 6, 2016, 7:17am UTC](https://discuss.elastic.co/t/node-local-stats-slow-3-nodes-cluster/54800/5 "2016-07-06T07:17:00Z")

</div>

Woah. That's a _lot_. How many nodes?

---

<div class="post-metadata">

**Author:** ![panda87](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@panda87](https://discuss.elastic.co/u/panda87)\
**Post date:** [July 6, 2016, 7:34am UTC](https://discuss.elastic.co/t/node-local-stats-slow-3-nodes-cluster/54800/6 "2016-07-06T07:34:28Z")

</div>

3 nodes - 8GB

---

<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:** [July 6, 2016, 7:45am UTC](https://discuss.elastic.co/t/node-local-stats-slow-3-nodes-cluster/54800/7 "2016-07-06T07:45:55Z")

</div>

You're **_excessively_** over sharded, you need to fix that.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 6, 2016, 7:47am UTC](https://discuss.elastic.co/t/node-local-stats-slow-3-nodes-cluster/54800/8 "2016-07-06T07:47:08Z")

</div>

Okay. 6000 shards for an 8 GB node is way way way too much. This is something you need to address. Given the fixed per-shard memory overhead I'm surprised your cluster hasn't collapsed.

To answer your original question , yes, node stats will take a very long time with so much cluster metadata. There's not much to do about that except reduce the amount of metadata.

What kind of indexes do you have? Time-series indexes? Multiple such series? Five shards per index?

---

<div class="post-metadata">

**Author:** ![panda87](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@panda87](https://discuss.elastic.co/u/panda87)\
**Post date:** [July 6, 2016, 8:16am UTC](https://discuss.elastic.co/t/node-local-stats-slow-3-nodes-cluster/54800/9 "2016-07-06T08:16:49Z")

</div>

I have 3 shards + 2 replicas per index  
and currently the indices are daily with retention of 90d after that we close them.

The indices are only for logs, from many services \ applications

---

<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:** [July 6, 2016, 8:17am UTC](https://discuss.elastic.co/t/node-local-stats-slow-3-nodes-cluster/54800/10 "2016-07-06T08:17:42Z")

</div>

> [@panda87](#):
>
> 2 replicas per index

Why?

How much data does all this cover?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 6, 2016, 8:19am UTC](https://discuss.elastic.co/t/node-local-stats-slow-3-nodes-cluster/54800/11 "2016-07-06T08:19:46Z")

</div>

How many index series? One per application? How many applications? How big is each such (daily) index?

---

<div class="post-metadata">

**Author:** ![panda87](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@panda87](https://discuss.elastic.co/u/panda87)\
**Post date:** [July 11, 2016, 10:27am UTC](https://discuss.elastic.co/t/node-local-stats-slow-3-nodes-cluster/54800/12 "2016-07-11T10:27:12Z")

</div>

Thanks guys for the help and for the ~ numbers I should expect in my cluster.

I almost finish to merge the daily indices to weekly (I hope to see something more build in to reindex weekly to monthly for X period of time)

Now my cluster has 350-400 active indices + 2500~ active shards and it behaves as expected.

May you have any other good tips?

Thanks  
D.

---

<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:36pm UTC](https://discuss.elastic.co/t/node-local-stats-slow-3-nodes-cluster/54800/13 "2017-07-05T22:36:37Z")

</div>


