# Indexing taking a lot of time due to GC overhead

**URL:** https://discuss.elastic.co/t/indexing-taking-a-lot-of-time-due-to-gc-overhead/82943
**Category:** Elasticsearch
**Created:** [April 19, 2017, 6:33pm UTC](https://discuss.elastic.co/t/indexing-taking-a-lot-of-time-due-to-gc-overhead/82943 "2017-04-19T18:33:50Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ChitraP](https://avatars.discourse-cdn.com/v4/letter/c/7ba0ec/32.png) [@ChitraP](https://discuss.elastic.co/u/ChitraP)
#### Post date: [April 19, 2017, 6:33pm UTC](https://discuss.elastic.co/t/indexing-taking-a-lot-of-time-due-to-gc-overhead/82943/1 "2017-04-19T18:33:50Z")

</div>

Issue: Indexing time drastically increased from 15 mins to 8 hrs for the same amount of data in past few weeks. We didn't really make any changes in particular to any of the nodes in the cluster. GC is taking a lot of time. [o.e.m.j.JvmGcMonitorService][gc][83699] overhead, spent [809ms] collecting in the last [1.2s]

Cluster details: 1 master & 2 clients. (16 GB memory), 6 data nodes (500 GB storage, 32 GB memory). Memory related settings on nodes include bootstrap.memory\_lock: true, MAX\_OPEN\_FILES=65536,MAX\_LOCKED\_MEMORY=unlimited' in /etc/sysconfig/elasticsearch, and half memory allocated to elastic search on all nodes.

Has anyone this GC issue or have any suggestions on how we can resolve it?  
Thanks in advance!

---

<div class="post-metadata">

### Author: ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)
#### Post date: [April 19, 2017, 7:34pm UTC](https://discuss.elastic.co/t/indexing-taking-a-lot-of-time-due-to-gc-overhead/82943/2 "2017-04-19T19:34:23Z")

</div>

What version of 5.x are you running?

---

<div class="post-metadata">

### Author: ![ChitraP](https://avatars.discourse-cdn.com/v4/letter/c/7ba0ec/32.png) [@ChitraP](https://discuss.elastic.co/u/ChitraP)
#### Post date: [April 19, 2017, 8:04pm UTC](https://discuss.elastic.co/t/indexing-taking-a-lot-of-time-due-to-gc-overhead/82943/3 "2017-04-19T20:04:29Z")

</div>

I am using 5.2.x

---

<div class="post-metadata">

### Author: ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)
#### Post date: [April 19, 2017, 8:43pm UTC](https://discuss.elastic.co/t/indexing-taking-a-lot-of-time-due-to-gc-overhead/82943/4 "2017-04-19T20:43:17Z")

</div>

Can you please share the JVM options of the running node? The easiest way to obtain this is by using `jps -l -m -v` on the running server and it will provide the JVM options for all running Java processes that your user has permissions to see.

---

<div class="post-metadata">

### Author: ![ChitraP](https://avatars.discourse-cdn.com/v4/letter/c/7ba0ec/32.png) [@ChitraP](https://discuss.elastic.co/u/ChitraP)
#### Post date: [April 19, 2017, 9:27pm UTC](https://discuss.elastic.co/t/indexing-taking-a-lot-of-time-due-to-gc-overhead/82943/5 "2017-04-19T21:27:21Z")

</div>

> [@jasontedor](#):
>
> jps -l -m -v

84265 org.elasticsearch.bootstrap.Elasticsearch -p /var/run/elasticsearch/elasticsearch.pid -Edefault.path.logs=/var/log/elasticsearch -Edefault.path.data=/var/lib/elasticsearch -Edefault.path.conf=/etc/elasticsearch -Xms16g -Xmx16g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -XX:+HeapDumpOnOutOfMemoryError -Des.path.home=/usr/share/elasticsearch  
17295 sun.tools.jps.Jps -l -m -v -Dapplication.home=/opt/java/jdk1.8.0\_112 -Xms8m

---

<div class="post-metadata">

### Author: ![ChitraP](https://avatars.discourse-cdn.com/v4/letter/c/7ba0ec/32.png) [@ChitraP](https://discuss.elastic.co/u/ChitraP)
#### Post date: [April 20, 2017, 7:04pm UTC](https://discuss.elastic.co/t/indexing-taking-a-lot-of-time-due-to-gc-overhead/82943/6 "2017-04-20T19:04:06Z")

</div>

@jasontedor I shared the jps -l -m -v output as you asked.

---

<div class="post-metadata">

### Author: ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)
#### Post date: [April 20, 2017, 9:15pm UTC](https://discuss.elastic.co/t/indexing-taking-a-lot-of-time-due-to-gc-overhead/82943/7 "2017-04-20T21:15:25Z")

</div>

What is your indexing pattern? Are you using bulk requests? What is the size of the bulk payload? Do you use auto-generated IDs? Do you have any monitoring that shows heap usage over time?

---

<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 18, 2017, 9:22pm UTC](https://discuss.elastic.co/t/indexing-taking-a-lot-of-time-due-to-gc-overhead/82943/8 "2017-05-18T21:22:32Z")

</div>

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