# Index document: very bad performance in Elasticsearch 8.2.0

**URL:** <https://discuss.elastic.co/t/index-document-very-bad-performance-in-elasticsearch-8-2-0/305392>\
**Category:** Elasticsearch\
**Created:** [May 23, 2022, 11:34am UTC](https://discuss.elastic.co/t/index-document-very-bad-performance-in-elasticsearch-8-2-0/305392 "2022-05-23T11:34:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Ott](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexander_ott/32/105905_2.png) [@Alexander\_Ott](https://discuss.elastic.co/u/Alexander_Ott)\
**Post date:** [May 23, 2022, 11:34am UTC](https://discuss.elastic.co/t/index-document-very-bad-performance-in-elasticsearch-8-2-0/305392/1 "2022-05-23T11:34:11Z")

</div>

We are trying to migrate from Elasticsearch 6.7.1 to Elasticsearch 8.2.0.

With the same amount of documents per bulk request, we always get a socket timeout in Elasticsearch 8.2.0. Everything works fine in Elasticsearch 6.7.1.

I noticed that indexing the same document in Elasticsearch 8.2.0 takes 44152ms. In Elasticsearch 6.7.1, indexing takes 50ms. Are there any known issues for Elasticsearch 8.2.0?

I created an issue for this problem --\> [bad indexing performance in elasticsearch 8.2.0 · Issue #87036 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues/87036)

---

<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 23, 2022, 11:34am UTC](https://discuss.elastic.co/t/index-document-very-bad-performance-in-elasticsearch-8-2-0/305392/2 "2022-05-23T11:34:11Z")

</div>

Elasticsearch 6.7.1 is [EOL](https://www.elastic.co/support/eol) and no longer supported. Please upgrade ASAP.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

---

<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:** [May 23, 2022, 4:23pm UTC](https://discuss.elastic.co/t/index-document-very-bad-performance-in-elasticsearch-8-2-0/305392/3 "2022-05-23T16:23:01Z")

</div>

Are the two clusters using exactly the same hardware? What is the specification of the clusters? What does the hot threads API show while the longer query executes?

---

<div class="post-metadata">

**Author:** ![Alexander\_Ott](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexander_ott/32/105905_2.png) [@Alexander\_Ott](https://discuss.elastic.co/u/Alexander_Ott)\
**Post date:** [May 24, 2022, 5:07am UTC](https://discuss.elastic.co/t/index-document-very-bad-performance-in-elasticsearch-8-2-0/305392/4 "2022-05-24T05:07:03Z")

</div>

It's just a single node for dev setup.

You can reproduce it with the requests which i added to [bad indexing performance in elasticsearch 8.2.0 · Issue #87036 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues/87036)

Hot Threads:

```auto
::: {es01}{OxiiGQ59StqP874DgpJLyQ}{pI5Cc7EETOSYDOPKiQTZvw}{172.31.0.2}{172.31.0.2:9300}{dm}{xpack.installed=true}
   Hot threads at 2022-05-23T14:52:47.572Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true:
   
   101.0% [cpu=101.0%, other=0.0%] (505.1ms out of 500ms) cpu usage by thread 'elasticsearch[es01][write][T#3]'
     3/10 snapshots sharing following 28 elements
       app//org.apache.lucene.util.UnicodeUtil.UTF16toUTF8(UnicodeUtil.java:174)
       app//org.apache.lucene.util.BytesRefBuilder.copyChars(BytesRefBuilder.java:141)
       app//org.apache.lucene.analysis.tokenattributes.CharTermAttributeImpl.getBytesRef(CharTermAttributeImpl.java:93)
       app//org.apache.lucene.index.IndexingChain$PerField.invert(IndexingChain.java:1224)
       app//org.apache.lucene.index.IndexingChain.processField(IndexingChain.java:733)
       app//org.apache.lucene.index.IndexingChain.processDocument(IndexingChain.java:620)
       app//org.apache.lucene.index.DocumentsWriterPerThread.updateDocuments(DocumentsWriterPerThread.java:241)
       app//org.apache.lucene.index.DocumentsWriter.updateDocuments(DocumentsWriter.java:432)
       app//org.apache.lucene.index.IndexWriter.updateDocuments(IndexWriter.java:1531)
       app//org.apache.lucene.index.IndexWriter.softUpdateDocuments(IndexWriter.java:1576)
       app//org.elasticsearch.index.engine.InternalEngine.updateDocs(InternalEngine.java:1375)
       app//org.elasticsearch.index.engine.InternalEngine.indexIntoLucene(InternalEngine.java:1188)
       app//org.elasticsearch.index.engine.InternalEngine.index(InternalEngine.java:995)
       app//org.elasticsearch.index.shard.IndexShard.index(IndexShard.java:1039)
       app//org.elasticsearch.index.shard.IndexShard.applyIndexOperation(IndexShard.java:972)
       app//org.elasticsearch.index.shard.IndexShard.applyIndexOperationOnPrimary(IndexShard.java:890)
       app//org.elasticsearch.action.bulk.TransportShardBulkAction.executeBulkItemRequest(TransportShardBulkAction.java:319)
       app//org.elasticsearch.action.bulk.TransportShardBulkAction$2.doRun(TransportShardBulkAction.java:185)
       app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
       app//org.elasticsearch.action.bulk.TransportShardBulkAction.performOnPrimary(TransportShardBulkAction.java:251)
       app//org.elasticsearch.action.bulk.TransportShardBulkAction.dispatchedShardOperationOnPrimary(TransportShardBulkAction.java:131)
       app//org.elasticsearch.action.bulk.TransportShardBulkAction.dispatchedShardOperationOnPrimary(TransportShardBulkAction.java:70)
       app//org.elasticsearch.action.support.replication.TransportWriteAction$1.doRun(TransportWriteAction.java:210)
       app//org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:773)
       app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
       java.base@18/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
       java.base@18/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
       java.base@18/java.lang.Thread.run(Thread.java:833)
     2/10 snapshots sharing following 25 elements
       app//org.apache.lucene.index.IndexingChain$PerField.invert(IndexingChain.java:1138)
       app//org.apache.lucene.index.IndexingChain.processField(IndexingChain.java:733)
       app//org.apache.lucene.index.IndexingChain.processDocument(IndexingChain.java:620)
       app//org.apache.lucene.index.DocumentsWriterPerThread.updateDocuments(DocumentsWriterPerThread.java:241)
       app//org.apache.lucene.index.DocumentsWriter.updateDocuments(DocumentsWriter.java:432)
       app//org.apache.lucene.index.IndexWriter.updateDocuments(IndexWriter.java:1531)
       app//org.apache.lucene.index.IndexWriter.softUpdateDocuments(IndexWriter.java:1576)
       app//org.elasticsearch.index.engine.InternalEngine.updateDocs(InternalEngine.java:1375)
       app//org.elasticsearch.index.engine.InternalEngine.indexIntoLucene(InternalEngine.java:1188)
       app//org.elasticsearch.index.engine.InternalEngine.index(InternalEngine.java:995)
       app//org.elasticsearch.index.shard.IndexShard.index(IndexShard.java:1039)
       app//org.elasticsearch.index.shard.IndexShard.applyIndexOperation(IndexShard.java:972)
       app//org.elasticsearch.index.shard.IndexShard.applyIndexOperationOnPrimary(IndexShard.java:890)
       app//org.elasticsearch.action.bulk.TransportShardBulkAction.executeBulkItemRequest(TransportShardBulkAction.java:319)
       app//org.elasticsearch.action.bulk.TransportShardBulkAction$2.doRun(TransportShardBulkAction.java:185)
       app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
       app//org.elasticsearch.action.bulk.TransportShardBulkAction.performOnPrimary(TransportShardBulkAction.java:251)
       app//org.elasticsearch.action.bulk.TransportShardBulkAction.dispatchedShardOperationOnPrimary(TransportShardBulkAction.java:131)
       app//org.elasticsearch.action.bulk.TransportShardBulkAction.dispatchedShardOperationOnPrimary(TransportShardBulkAction.java:70)
       app//org.elasticsearch.action.support.replication.TransportWriteAction$1.doRun(TransportWriteAction.java:210)
       app//org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:773)
       app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
       java.base@18/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
       java.base@18/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
       java.base@18/java.lang.Thread.run(Thread.java:833)
     5/10 snapshots sharing following 23 elements
       app//org.apache.lucene.index.IndexingChain.processDocument(IndexingChain.java:620)
       app//org.apache.lucene.index.DocumentsWriterPerThread.updateDocuments(DocumentsWriterPerThread.java:241)
       app//org.apache.lucene.index.DocumentsWriter.updateDocuments(DocumentsWriter.java:432)
       app//org.apache.lucene.index.IndexWriter.updateDocuments(IndexWriter.java:1531)
       app//org.apache.lucene.index.IndexWriter.softUpdateDocuments(IndexWriter.java:1576)
       app//org.elasticsearch.index.engine.InternalEngine.updateDocs(InternalEngine.java:1375)
       app//org.elasticsearch.index.engine.InternalEngine.indexIntoLucene(InternalEngine.java:1188)
       app//org.elasticsearch.index.engine.InternalEngine.index(InternalEngine.java:995)
       app//org.elasticsearch.index.shard.IndexShard.index(IndexShard.java:1039)
       app//org.elasticsearch.index.shard.IndexShard.applyIndexOperation(IndexShard.java:972)
       app//org.elasticsearch.index.shard.IndexShard.applyIndexOperationOnPrimary(IndexShard.java:890)
       app//org.elasticsearch.action.bulk.TransportShardBulkAction.executeBulkItemRequest(TransportShardBulkAction.java:319)
       app//org.elasticsearch.action.bulk.TransportShardBulkAction$2.doRun(TransportShardBulkAction.java:185)
       app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
       app//org.elasticsearch.action.bulk.TransportShardBulkAction.performOnPrimary(TransportShardBulkAction.java:251)
       app//org.elasticsearch.action.bulk.TransportShardBulkAction.dispatchedShardOperationOnPrimary(TransportShardBulkAction.java:131)
       app//org.elasticsearch.action.bulk.TransportShardBulkAction.dispatchedShardOperationOnPrimary(TransportShardBulkAction.java:70)
       app//org.elasticsearch.action.support.replication.TransportWriteAction$1.doRun(TransportWriteAction.java:210)
       app//org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:773)
       app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
       java.base@18/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
       java.base@18/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
       java.base@18/java.lang.Thread.run(Thread.java:833)

```

---

<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:** [June 21, 2022, 5:07am UTC](https://discuss.elastic.co/t/index-document-very-bad-performance-in-elasticsearch-8-2-0/305392/5 "2022-06-21T05:07:48Z")

</div>

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