# Increase in Elasticsearch search latency after increasing instance memory to 64GB

**URL:** <https://discuss.elastic.co/t/increase-in-elasticsearch-search-latency-after-increasing-instance-memory-to-64gb/224223>\
**Category:** Elasticsearch\
**Created:** [March 19, 2020, 7:17am UTC](https://discuss.elastic.co/t/increase-in-elasticsearch-search-latency-after-increasing-instance-memory-to-64gb/224223 "2020-03-19T07:17:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![the123saurav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/the123saurav/32/47551_2.png) [@the123saurav](https://discuss.elastic.co/u/the123saurav)\
**Post date:** [March 19, 2020, 7:17am UTC](https://discuss.elastic.co/t/increase-in-elasticsearch-search-latency-after-increasing-instance-memory-to-64gb/224223/1 "2020-03-19T07:17:23Z")

</div>

We are using ES 6.0.  
We do not have any analysers in our index and all fields are "keyword" OR number OR date field.  
Our search queries are also simple bool queries without any aggregation.

We are using EC2, and our past configuration was 8c/32GB machines(heap size 16GB) with 400GB EBS based SSD storage.  
We recently switched to 8c/64GB(heap size 32GB ) which has better processor and to our surprise we found that our search latency increased from 40ms to 70ms.  
I checked that Heap, GC & CPU metrics are fine, infact heap usage is very less.  
I also checked that compressed oops pointer flag was true for the JVM.

Is there any possible explanation for this?  
PS: Feel free to ask for any sort of clarifications. Any help would be great for me.

---

<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:** [March 19, 2020, 10:27am UTC](https://discuss.elastic.co/t/increase-in-elasticsearch-search-latency-after-increasing-instance-memory-to-64gb/224223/2 "2020-03-19T10:27:30Z")

</div>

Heap should be no larger than around 30GB so that you benefit from compressed pointers. Try lowering it a bit to see if it makes a difference. Elasticsearch is s as Leo often limited by disk I/O rather than CPU, so more cores might not necessarily mean better latency unless you were CPU bound before.

---

<div class="post-metadata">

**Author:** ![the123saurav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/the123saurav/32/47551_2.png) [@the123saurav](https://discuss.elastic.co/u/the123saurav)\
**Post date:** [March 23, 2020, 11:57am UTC](https://discuss.elastic.co/t/increase-in-elasticsearch-search-latency-after-increasing-instance-memory-to-64gb/224223/3 "2020-03-23T11:57:18Z")

</div>

> [@the123saurav](#):
>
> I also checked that compressed oops pointer flag was true for the JVM.

As pointed in the details, I see that compressed oops pointer flag was true for the JVM.  
So I don't think that is an issue.

---

<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:** [April 21, 2020, 7:27am UTC](https://discuss.elastic.co/t/increase-in-elasticsearch-search-latency-after-increasing-instance-memory-to-64gb/224223/5 "2020-04-21T07:27:15Z")

</div>

Closed on April 21, 2020, 7:27am UTC

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