# Failed to process cluster event Exception

**URL:** <https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451>\
**Category:** Elasticsearch\
**Created:** [October 10, 2017, 11:29pm UTC](https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451 "2017-10-10T23:29:47Z")\
**Posts on this page:** 13\
**Page:** 2

<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:** [October 11, 2017, 5:00am UTC](https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451/21 "2017-10-11T05:00:48Z")

</div>

> [@Pradeep\_Gowda](#):
>
> How much data can I store in one index in terms of size.

That depends on the shard count. That blog provides a lot of great info.

> [@Pradeep\_Gowda](#):
>
> Will it impact query and aggregation?

Potentially. You see to me ok with testing, so look at setting up Rally with different shard count/sizes.

---

<div class="post-metadata">

**Author:** ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)\
**Post date:** [October 11, 2017, 5:03am UTC](https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451/22 "2017-10-11T05:03:37Z")

</div>

Initial idea was to have one primary and two replicas to handle failover. will go through the documents and will get back to u with the test result.

---

<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:** [October 11, 2017, 5:14am UTC](https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451/23 "2017-10-11T05:14:54Z")

</div>

Is your data important enough and the failure risk high enough to have two replicas though? I don't know your environment and requirements, but I figure I'd ask.

Having two replica's isn't a bad idea, you just need to be aware of the tradeoffs other than just having 50% more data/shards/indices in your cluster 🙂

---

<div class="post-metadata">

**Author:** ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)\
**Post date:** [October 11, 2017, 6:13am UTC](https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451/24 "2017-10-11T06:13:45Z")

</div>

Yes, Data is very important and failover must be handled. Adding extra node is not a problem. Just need to know how far I can go in terms of scaling wrt index count and aggressive indexing and aggregating.

---

<div class="post-metadata">

**Author:** ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)\
**Post date:** [October 11, 2017, 6:28pm UTC](https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451/25 "2017-10-11T18:28:27Z")

</div>

Hi @warkolm  
Coming back to the main problem, Why am I seeing lots of pending task on each node? Let's consider my current setup with no replica

---

<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:** [October 12, 2017, 2:35am UTC](https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451/26 "2017-10-12T02:35:48Z")

</div>

Have a look at hot threads, it might add more.

But it's likely because you have too many shards.

---

<div class="post-metadata">

**Author:** ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)\
**Post date:** [October 12, 2017, 2:39am UTC](https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451/27 "2017-10-12T02:39:31Z")

</div>

Most of them are shard initializing and indexing. Some say's the reason as NODE\_LEFT. But I haven't seen any node getting disconnected. Do you recommend to increase the default timeout of 30s? And what all settings should I look into in scaled deployments like mine?

---

<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:** [October 12, 2017, 2:52am UTC](https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451/28 "2017-10-12T02:52:00Z")

</div>

You should reduce your shard count.

I know I repeat that, but it's important. Each time a shard needs to be moved or have a change in state, if a node leaves or joins, if an index is created or updated, is a mapping is created or updated, the cluster master needs to update the cluster state.

In 5.X cluster states are propagated as deltas, whereas in 2.X we'd apply the change and then push the full state out to each node. So 5.X is much more efficient with this.

But when you have 45000 shards, that means that the node routing/mapping state is huge. Irrespective of applying cluster state changes as just the deltas, iterating through a routing state of that size just to move even a single is a big job.

Changing settings here is only ignoring the problem. Reduce your shard count for this many nodes is the real solution.

---

<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:** [October 12, 2017, 2:53am UTC](https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451/29 "2017-10-12T02:53:28Z")

</div>

To give you more context look at this - [https://twitter.com/fdevillamil/status/917044462622330880/photo/1](https://twitter.com/fdevillamil/status/917044462622330880/photo/1)

- _39899 shards_
- **186 nodes**

They also have dedicated master nodes, with relatively powerful infrastructure.

You have 3 nodes and 45000 shards. There's a fair bit of a difference there.

---

<div class="post-metadata">

**Author:** ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)\
**Post date:** [October 12, 2017, 3:14am UTC](https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451/30 "2017-10-12T03:14:42Z")

</div>

@warkolm Thank you very much. Definalty will look into reducing the number of shards for my use case and look into testing it on 5.x. Will get back to you if I have any quires.

---

<div class="post-metadata">

**Author:** ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)\
**Post date:** [October 18, 2017, 10:45pm UTC](https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451/31 "2017-10-18T22:45:38Z")

</div>

Have a quick question on this. How did we come up with 300-500 shards? Is this number stands well when each shard are running with max capacity (2.1 billion records)?. If I reduce the document count per shard to 1billion can I have 600 to 1000 shards? How to find out how many shards I can have in a node?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 19, 2017, 11:17am UTC](https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451/32 "2017-10-19T11:17:56Z")

</div>

The recommendation around number of shards per node in a cluster described in the blog post Mark linked to earlier in this thread is based on what we see in the field across multiple types of deployments. It is meant as a guideline and is not an absolute limit.

What drives this is the memory overhead that each shard/segment comes with, which is not linear. Larger shards/segments typically have a lower proportion of overhead compared to the data volume than smaller shards. Having twice the number of shards with the same amount of documents is therefore likely to result in more overhead.

Exactly how much overhead your cluster can handle depends on how much heap querying and indexing requires, and this will depend a lot on the use case. I know of users running with more shards than what we recommended in the blog post, but also other users that had to set the limit lower.

The only way to accurately find out what the limit is for your use case is to test and benchmark with your data and work load.

---

<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:** [November 16, 2017, 11:18am UTC](https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451/33 "2017-11-16T11:18:07Z")

</div>

Closed on November 16, 2017, 11:18am UTC

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

[Previous page](https://discuss.elastic.co/t/failed-to-process-cluster-event-exception/103451.md?page=1)
