# Shard has exceeded the maximum number of retries

**URL:** https://discuss.elastic.co/t/shard-has-exceeded-the-maximum-number-of-retries/215954
**Category:** Elasticsearch
**Created:** [January 21, 2020, 9:37pm UTC](https://discuss.elastic.co/t/shard-has-exceeded-the-maximum-number-of-retries/215954 "2020-01-21T21:37:34Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![DeeeFOX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deeefox/32/49566_2.png) [@DeeeFOX](https://discuss.elastic.co/u/DeeeFOX)
#### Post date: [January 23, 2020, 4:51am UTC](https://discuss.elastic.co/t/shard-has-exceeded-the-maximum-number-of-retries/215954/5 "2020-01-23T04:51:43Z")

</div>

Ahh, seem that the actual reason is the unpredictable mem usage rise after upgrade!

That make me remember some discuss, about the jvm setting that trigger the breaker happens

1. [parent-circuit-breaker-calculation-seems-to-be-wrong-with-version-7-x](https://discuss.elastic.co/t/parent-circuit-breaker-calculation-seems-to-be-wrong-with-version-7-x/183530/11)
2. [circuitbreakingexception-parent-data-too-large-in-es-7-x](https://discuss.elastic.co/t/circuitbreakingexception-parent-data-too-large-in-es-7-x/192801/7)
3. [g1gc-cause-circuitbreakingexception-parent-data-too-large-on-7-1-1](https://discuss.elastic.co/t/g1gc-cause-circuitbreakingexception-parent-data-too-large-on-7-1-1/187272)

And which also make breaker occasionally happened in our cluster after upgrade to 7.4.

By then we change the jvm default setting to the bellow settings in our [tsdb use case](https://discuss.elastic.co/t/can-es-not-to-store-original-keyword-content-but-a-mapping-num-value-4-save-space/215664):  
And breakers (to us are caused by indices.breaker.request) never happen again!

```
################################################################

# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space

-Xms31g
-Xmx31g

################################################################
## Expert settings
################################################################
##
## All settings below this section are considered
## expert settings. Don't tamper with them unless
## you understand what you are doing
##
################################################################

## GC configuration
# # # # # # -XX:+UseConcMarkSweepGC
# # # # # # -XX:CMSInitiatingOccupancyFraction=75
# # # # # # -XX:+UseCMSInitiatingOccupancyOnly

## G1GC Configuration
# NOTE: G1GC is only supported on JDK version 10 or later.
# To use G1GC uncomment the lines below.
10-:-XX:-UseConcMarkSweepGC
10-:-XX:-UseCMSInitiatingOccupancyOnly
10-:-XX:+UseG1GC
## optimizations
10-:-XX:InitiatingHeapOccupancyPercent=30 ## <---- main reason, don't set it higher than 40
10-:-XX:MaxGCPauseMillis=5 ## <---- let gc happens more frequently
10-:-XX:GCPauseIntervalMillis=10 ## <---- let gc happens more frequently
-XX:+UseCompressedOops
-XX:+DisableExplicitGC

## optimizations

```

Wish it can fix ur problem!

---

_[View the full topic](https://discuss.elastic.co/t/shard-has-exceeded-the-maximum-number-of-retries/215954)._
