# Elasticsearch G1GC over CMS in resolving the GC overhead

**URL:** https://discuss.elastic.co/t/elasticsearch-g1gc-over-cms-in-resolving-the-gc-overhead/330744
**Category:** Elasticsearch
**Created:** [April 25, 2023, 1:25pm UTC](https://discuss.elastic.co/t/elasticsearch-g1gc-over-cms-in-resolving-the-gc-overhead/330744 "2023-04-25T13:25:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![navaneethan](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@navaneethan](https://discuss.elastic.co/u/navaneethan)
#### Post date: [April 25, 2023, 1:25pm UTC](https://discuss.elastic.co/t/elasticsearch-g1gc-over-cms-in-resolving-the-gc-overhead/330744/1 "2023-04-25T13:25:46Z")

</div>

We are using the ES 7.3 with CMS GC and we are preparing for the rolling upgrade to 7.17 which supports G1GC only

We are getting the GC overhead curently,

[2023-04-25T02:00:41,085][WARN][o.e.m.j.JvmGcMonitorService] [es7-cf-74] [gc][434743] overhead, spent [717ms] collecting in the last [1s]  
[2023-04-25T02:00:45,529][INFO][o.e.m.j.JvmGcMonitorService] [es7-cf-74] [gc][434747] overhead, spent [438ms] collecting in the last [1.4s]

Is there a chance that G1GC handle this well and we wont get this over head in 7.17

The data node heap spikes & reduce suddenly while overhead and we are facing request failures in CMS recently

---

<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: [April 25, 2023, 11:08pm UTC](https://discuss.elastic.co/t/elasticsearch-g1gc-over-cms-in-resolving-the-gc-overhead/330744/2 "2023-04-25T23:08:51Z")

</div>

> [@navaneethan](#):
>
> Is there a chance that G1GC handle this well and we wont get this over head in 7.17

Maybe.

What is the output from the [`_cluster/stats?pretty&human` API](https://www.elastic.co/guide/en/elasticsearch/reference/8.4/cluster-stats.html)?

---

<div class="post-metadata">

### Author: ![navaneethan](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@navaneethan](https://discuss.elastic.co/u/navaneethan)
#### Post date: [April 27, 2023, 7:39am UTC](https://discuss.elastic.co/t/elasticsearch-g1gc-over-cms-in-resolving-the-gc-overhead/330744/3 "2023-04-27T07:39:16Z")

</div>

{  
"\_nodes": {  
"total": 8,  
"successful": 8,  
"failed": 0  
},  
"cluster\_name": "es7",  
"cluster\_uuid": "#####",  
"timestamp": 1682580993561,  
"status": "green",  
"indices": {  
"count": 40,  
"shards": {  
"total": 368,  
"primaries": 184,  
"replication": 1.0,  
"index": {  
"shards": {  
"min": 2,  
"max": 10,  
"avg": 9.2  
},  
"primaries": {  
"min": 1,  
"max": 5,  
"avg": 4.6  
},  
"replication": {  
"min": 1.0,  
"max": 1.0,  
"avg": 1.0  
}  
}  
},  
"docs": {  
"count": 55845371,  
"deleted": 1115791  
},  
"store": {  
"size": "328.9gb",  
"size\_in\_bytes": 353241656447  
},  
"fielddata": {  
"memory\_size": "0b",  
"memory\_size\_in\_bytes": 0,  
"evictions": 0  
},  
"query\_cache": {  
"memory\_size": "4.2mb",  
"memory\_size\_in\_bytes": 4430350,  
"total\_count": 9853952,  
"hit\_count": 4249977,  
"miss\_count": 5603975,  
"cache\_size": 239,  
"cache\_count": 104683,  
"evictions": 104444  
},  
"completion": {  
"size": "0b",  
"size\_in\_bytes": 0  
},  
"segments": {  
"count": 2265,  
"memory": "161.4mb",  
"memory\_in\_bytes": 169322757,  
"terms\_memory": "31.9mb",  
"terms\_memory\_in\_bytes": 33489221,  
"stored\_fields\_memory": "124.5mb",  
"stored\_fields\_memory\_in\_bytes": 130635336,  
"term\_vectors\_memory": "0b",  
"term\_vectors\_memory\_in\_bytes": 0,  
"norms\_memory": "44.8kb",  
"norms\_memory\_in\_bytes": 45888,  
"points\_memory": "3.4mb",  
"points\_memory\_in\_bytes": 3640870,  
"doc\_values\_memory": "1.4mb",  
"doc\_values\_memory\_in\_bytes": 1511442,  
"index\_writer\_memory": "2mb",  
"index\_writer\_memory\_in\_bytes": 2154026,  
"version\_map\_memory": "410b",  
"version\_map\_memory\_in\_bytes": 410,  
"fixed\_bit\_set": "6.4mb",  
"fixed\_bit\_set\_memory\_in\_bytes": 6768528,  
"max\_unsafe\_auto\_id\_timestamp": 1682578685666,  
"file\_sizes": {  
}  
}  
},  
"nodes": {  
"count": {  
"total": 8,  
"coordinating\_only": 0,  
"data": 5,  
"ingest": 0,  
"master": 3,  
"voting\_only": 0  
},  
"versions": [  
"7.3.2"  
],  
"os": {  
"available\_processors": 106,  
"allocated\_processors": 106,  
"names": [  
{  
"name": "Linux",  
"count": 8  
}  
],  
"pretty\_names": [  
{  
"pretty\_name": "Ubuntu 20.04.6 LTS",  
"count": 8  
}  
],  
"mem": {  
"total": "824.2gb",  
"total\_in\_bytes": 885082402816,  
"free": "168.4gb",  
"free\_in\_bytes": 180843520000,  
"used": "655.8gb",  
"used\_in\_bytes": 704238882816,  
"free\_percent": 20,  
"used\_percent": 80  
}  
},  
"process": {  
"cpu": {  
"percent": 10  
},  
"open\_file\_descriptors": {  
"min": 560,  
"max": 6454,  
"avg": 3351  
}  
},  
"jvm": {  
"max\_uptime": "7.8d",  
"max\_uptime\_in\_millis": 682300549,  
"versions": [  
{  
"version": "1.8.0\_131",  
"vm\_name": "Java HotSpot(TM) 64-Bit Server VM",  
"vm\_version": "25.131-b11",  
"vm\_vendor": "Oracle Corporation",  
"bundled\_jdk": true,  
"using\_bundled\_jdk": false,  
"count": 8  
}  
],  
"mem": {  
"heap\_used": "22.3gb",  
"heap\_used\_in\_bytes": 23950037104,  
"heap\_max": "56.5gb",  
"heap\_max\_in\_bytes": 60699967488  
},  
"threads": 963  
},  
"fs": {  
"total": "2.8tb",  
"total\_in\_bytes": 3081931849728,  
"free": "1tb",  
"free\_in\_bytes": 1198002884608,  
"available": "1tb",  
"available\_in\_bytes": 1197902221312  
},  
"plugins": [  
{  
"name": "repository-gcs",  
"version": "7.3.2",  
"elasticsearch\_version": "7.3.2",  
"java\_version": "1.8",  
"description": "The GCS repository plugin adds Google Cloud Storage support for repositories.",  
"classname": "org.elasticsearch.repositories.gcs.GoogleCloudStoragePlugin",  
"extended\_plugins": [  
],  
"has\_native\_controller": false  
}  
],  
"network\_types": {  
"transport\_types": {  
"security4": 8  
},  
"http\_types": {  
"security4": 8  
}  
},  
"discovery\_types": {  
"zen": 8  
},  
"packaging\_types": [  
{  
"flavor": "default",  
"type": "tar",  
"count": 8  
}  
]  
}  
}

---

<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: [April 30, 2023, 11:21pm UTC](https://discuss.elastic.co/t/elasticsearch-g1gc-over-cms-in-resolving-the-gc-overhead/330744/4 "2023-04-30T23:21:48Z")

</div>

You have 8 nodes with about 8 gig of heap each, but your hosts have 820 gig of memory, why is your heap so low? It doesn't need to be super high, but you seem to have lots of memory to use, and I would look to increase the heap size a bit to reduce the pressure.

Also upgrading Elasticsearch and your JVM will help.

---

<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: [May 28, 2023, 11:22pm UTC](https://discuss.elastic.co/t/elasticsearch-g1gc-over-cms-in-resolving-the-gc-overhead/330744/5 "2023-05-28T23:22:29Z")

</div>

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