# Elasticsearch performance degraded after migration from 1.4 to 5.4

**URL:** https://discuss.elastic.co/t/elasticsearch-performance-degraded-after-migration-from-1-4-to-5-4/120159
**Category:** Elasticsearch
**Created:** [February 16, 2018, 11:59am UTC](https://discuss.elastic.co/t/elasticsearch-performance-degraded-after-migration-from-1-4-to-5-4/120159 "2018-02-16T11:59:37Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Nitish\_Goyal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nitish_goyal/32/54988_2.png) [@Nitish\_Goyal](https://discuss.elastic.co/u/Nitish_Goyal)
#### Post date: [February 16, 2018, 11:59am UTC](https://discuss.elastic.co/t/elasticsearch-performance-degraded-after-migration-from-1-4-to-5-4/120159/1 "2018-02-16T11:59:37Z")

</div>

Hi,

We have recently migrated our es clusters from 1.4 to 5.4 and seeing degradation in the performance.

This query is taking around ~30-40 ms in es 5.4  
If we execute the same query in es 1.4 , the same query takes ~8-12 ms

{  
"from": 0,  
"size": 100,  
"query": {  
"constant\_score": {  
"filter": {  
"bool": {  
"must": [  
{  
"term": {  
"entityType": {  
"value": "PAID\_INITIATIVE"  
}  
}  
}  
]  
}  
}  
}  
}  
}

Any insights on this would be really really helpful

Thanks,  
Nitish

---

<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: [February 20, 2018, 7:58am UTC](https://discuss.elastic.co/t/elasticsearch-performance-degraded-after-migration-from-1-4-to-5-4/120159/2 "2018-02-20T07:58:39Z")

</div>

How are you measuring it?  
Have you load tested?  
What JVM? What OS? What hardware?  
What's the mapping?  
What else is happening in your cluster when you query?

---

<div class="post-metadata">

### Author: ![Nitish\_Goyal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nitish_goyal/32/54988_2.png) [@Nitish\_Goyal](https://discuss.elastic.co/u/Nitish_Goyal)
#### Post date: [February 20, 2018, 4:26pm UTC](https://discuss.elastic.co/t/elasticsearch-performance-degraded-after-migration-from-1-4-to-5-4/120159/3 "2018-02-20T16:26:12Z")

</div>

JVM : Java 8  
Hardware is same for both the clusters  
We aren't using both the cluster for any other queries except for load testing

And yes, we are running a script to capture response of 100 such different queries

Issue becomes deep when we query for 100k docs (size : 100k)

We have a use case, where we need to filter 100k docs  
I have tested with both LZ4 and best\_compression in es 5 cluster. Performance is bad in both cases

For 100k docs  
Es 1.4 : ~2s  
ES 5.4 : ~3.5s (LZ4)  
ES 5.4 : ~ 5s (best\_compression)

Kindly help

Thanks,  
Nitish

---

<div class="post-metadata">

### Author: ![Nitish\_Goyal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nitish_goyal/32/54988_2.png) [@Nitish\_Goyal](https://discuss.elastic.co/u/Nitish_Goyal)
#### Post date: [February 21, 2018, 2:01pm UTC](https://discuss.elastic.co/t/elasticsearch-performance-degraded-after-migration-from-1-4-to-5-4/120159/4 "2018-02-21T14:01:34Z")

</div>

Hi,

I have checked the hot threads

Most of the threads are stuck at decompress

100.2% (501ms out of 500ms) cpu usage by thread 'elasticsearch[es-data-nqa-spr\_nqa\_elasticsearch-5.4-1-7-1c][[transport\_server\_worker.default]][T#12]'  
7/10 snapshots sharing following 52 elements  
java.util.zip.Inflater.inflateBytes(Native Method)  
java.util.zip.Inflater.inflate(Inflater.java:259)  
org.apache.lucene.codecs.compressing.CompressionMode$DeflateDecompressor.decompress(CompressionMode.java:224)  
org.apache.lucene.codecs.compressing.CompressingStoredFieldsReader$BlockState.document(CompressingStoredFieldsReader.java:560)  
org.apache.lucene.codecs.compressing.CompressingStoredFieldsReader.document(CompressingStoredFieldsReader.java:576)  
org.apache.lucene.codecs.compressing.CompressingStoredFieldsReader.visitDocument(CompressingStoredFieldsReader.java:583)  
org.apache.lucene.index.CodecReader.document(CodecReader.java:88)  
org.apache.lucene.index.FilterLeafReader.document(FilterLeafReader.java:411)  
org.elasticsearch.search.fetch.FetchPhase.loadStoredFields(FetchPhase.java:347)

I just need the id from the documents, even when I try with stored\_fields : ["id"], it still decompresses the documents  
Any insights on how we can surpass this?

---

<div class="post-metadata">

### Author: ![Nitish\_Goyal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nitish_goyal/32/54988_2.png) [@Nitish\_Goyal](https://discuss.elastic.co/u/Nitish_Goyal)
#### Post date: [February 26, 2018, 1:33pm UTC](https://discuss.elastic.co/t/elasticsearch-performance-degraded-after-migration-from-1-4-to-5-4/120159/5 "2018-02-26T13:33:41Z")

</div>

@warkolm: Hi Mark, can you please share some insights on the above?

Thanks,  
Nitish

---

<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: [February 26, 2018, 9:21pm UTC](https://discuss.elastic.co/t/elasticsearch-performance-degraded-after-migration-from-1-4-to-5-4/120159/6 "2018-02-26T21:21:38Z")

</div>

It's difficult to say without a way to replicate this.

---

<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: [March 26, 2018, 9:22pm UTC](https://discuss.elastic.co/t/elasticsearch-performance-degraded-after-migration-from-1-4-to-5-4/120159/7 "2018-03-26T21:22:05Z")

</div>

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