# Timeout and slow responses

**URL:** <https://discuss.elastic.co/t/timeout-and-slow-responses/289418>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [November 17, 2021, 9:03am UTC](https://discuss.elastic.co/t/timeout-and-slow-responses/289418 "2021-11-17T09:03:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ook](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ook/32/97196_2.png) [@ook](https://discuss.elastic.co/u/ook)\
**Post date:** [November 17, 2021, 9:03am UTC](https://discuss.elastic.co/t/timeout-and-slow-responses/289418/1 "2021-11-17T09:03:23Z")

</div>

Hi,  
I have a Elasticsearch cluster in my k8s cluster to handle a unique small (451k docs) index (here the stats: [ES Cluster stats as at 20211117 · GitHub](https://gist.github.com/ook/fcc5f695cbb1db3974d5df5118313706) ), so small (2gb) that I use 1 shard. All 5 nodes pods have 1CPU, 3Gbi RAM and JVM is configured with xms=xmx=2Gb.

```auto
creations 0 p STARTED 451887 2gb 10.42.9.3 elasticsearch-master-1
creations 0 r STARTED 451882 1.9gb 10.42.10.34 elasticsearch-master-0
creations 0 r STARTED 451884 1.9gb 10.42.11.4 elasticsearch-master-3
creations 0 r STARTED 451879 1.5gb 10.42.5.125 elasticsearch-master-4
creations 0 r STARTED 451887 2gb 10.42.0.180 elasticsearch-master-2

```

As you can see, there's 1 primary and 4 replicas.  
My problems:

- slow query response
- slow update of the index  
Both meet many timeouts and some "org.Elasticsearch.action.search.SearchPhaseExecutionException: all shards failed"" errors: [Some ES timeout logs · GitHub](https://gist.github.com/ook/b35f86de32537a064de6bc1dc0d73e5c)

How could I improve my response time and avoid timeout? Should I give more resources to the pods? Make a multiple primary node shards?

Thank you for your pointers.

---

<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:** [November 17, 2021, 9:42am UTC](https://discuss.elastic.co/t/timeout-and-slow-responses/289418/2 "2021-11-17T09:42:19Z")

</div>

What type of storage are you using?

---

<div class="post-metadata">

**Author:** ![ook](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ook/32/97196_2.png) [@ook](https://discuss.elastic.co/u/ook)\
**Post date:** [November 17, 2021, 10:14am UTC](https://discuss.elastic.co/t/timeout-and-slow-responses/289418/3 "2021-11-17T10:14:41Z")

</div>

No persistence at all, so I guess in memory + ephemeral storage, nodes are mainly HDD 7200rpm and some nodes should have SSD.  
Does it help?

---

<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:** [November 17, 2021, 10:21am UTC](https://discuss.elastic.co/t/timeout-and-slow-responses/289418/4 "2021-11-17T10:21:57Z")

</div>

Elasticsearch does not run in memory, so the storage used will matter and can often be the bottleneck. I would recommend looking into storage performance.

Elasticsearch also relies on the operating page cache for performance so the fact that you have assigned over 50% of available RAM to heap probably affects performance negatively too.

---

<div class="post-metadata">

**Author:** ![ook](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ook/32/97196_2.png) [@ook](https://discuss.elastic.co/u/ook)\
**Post date:** [November 17, 2021, 10:48am UTC](https://discuss.elastic.co/t/timeout-and-slow-responses/289418/5 "2021-11-17T10:48:45Z")

</div>

Thank you for the hint, here a hdparm test for one of the node (all will be comparable):

```auto
/dev/md2:
 HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
 readonly = 0 (off)
 readahead = 4096 (on)
 geometry = 233225216/2/4, sectors = 1865801728, start = unknown
 Timing cached reads: 13872 MB in 1.99 seconds = 6963.47 MB/sec
 Timing buffered disk reads: 1482 MB in 3.01 seconds = 493.16 MB/sec

```

It doesn't seems very low, especially for such a small index, don't you think? What performance should I reach to avoid timeout?

---

<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:** [November 17, 2021, 11:18am UTC](https://discuss.elastic.co/t/timeout-and-slow-responses/289418/6 "2021-11-17T11:18:05Z")

</div>

Elasticsearch does a lot of reasonably small reads and writes with frequent fsyncs during indexing so I am not sure that benchmark is representative.

---

<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:** [December 15, 2021, 11:18am UTC](https://discuss.elastic.co/t/timeout-and-slow-responses/289418/7 "2021-12-15T11:18:54Z")

</div>

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