# Search node getting slow down when Codecache is Full

**URL:** <https://discuss.elastic.co/t/search-node-getting-slow-down-when-codecache-is-full/24850>\
**Category:** Elasticsearch\
**Created:** [July 3, 2015, 9:14am UTC](https://discuss.elastic.co/t/search-node-getting-slow-down-when-codecache-is-full/24850 "2015-07-03T09:14:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![haandol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/haandol/32/3563_2.png) [@haandol](https://discuss.elastic.co/u/haandol)\
**Post date:** [July 3, 2015, 9:14am UTC](https://discuss.elastic.co/t/search-node-getting-slow-down-when-codecache-is-full/24850/1 "2015-07-03T09:14:45Z")

</div>

my server, r3.2xlarge 8core 60G, is on the AWS. and I use obviously Elasticsearch 1.4 on JVM 1.8 with CMS GC for FGC and ParallelNewGC for YGC.

I run ES with these opts,

```
./bin/elasticsearch -Xms30g -Xmx30g -XX:NewRatio=2 -XX:ReservedCodeCacheSize=2g -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseParNewGC

```

just after run the ES, HQ said everything's fine and no slow query logs appear for a while.  
but when about 8 hours past 'Codecache is Full' warning appears and ES search query is getting slow down horribly.  
(approximately 200ms to 2s)

I just want to know why my codecache is full so often? and what should I do to avoid fulfilling codecache?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [July 3, 2015, 2:15pm UTC](https://discuss.elastic.co/t/search-node-getting-slow-down-when-codecache-is-full/24850/2 "2015-07-03T14:15:12Z")

</div>

> [@haandol](#):
>
> I just want to know why my codecache is full so often? and what should I do to avoid fulfilling codecache?

Its really hard to tell from the what you've written but my first guess is dynamic scripting where you build parameters into the script so it has to be recompiled.

What do the code cache warning look like? What do your queries look like?

> [@haandol](#):
>
> my server, r3.2xlarge 8core 60G, is on the AWS. and I use obviously Elasticsearch 1.4 on JVM 1.8 with CMS GC for FGC and ParallelNewGC for YGC.

1.4 isn't an obvious version - firstly its not a complete version number, and secondly its reasonably old. Also, why are you using non-default GC settings? Did you run some analysis and find them better? Also I've never tried setting get settings that way. I imagine you've verified that they made their way to the java process but if you haven't its probably worth doing.

---

<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 6, 2017, 12:03am UTC](https://discuss.elastic.co/t/search-node-getting-slow-down-when-codecache-is-full/24850/3 "2017-07-06T00:03:43Z")

</div>


