# Random slow query after some time of idle

**URL:** https://discuss.elastic.co/t/random-slow-query-after-some-time-of-idle/346783
**Category:** Elasticsearch
**Tags:** language-clients
**Created:** [November 9, 2023, 11:53am UTC](https://discuss.elastic.co/t/random-slow-query-after-some-time-of-idle/346783 "2023-11-09T11:53:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![LeoL](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@LeoL](https://discuss.elastic.co/u/LeoL)
#### Post date: [November 9, 2023, 11:53am UTC](https://discuss.elastic.co/t/random-slow-query-after-some-time-of-idle/346783/1 "2023-11-09T11:53:42Z")

</div>

Hello,  
I explain our stituation. We have a pod on OpenShift with a .NET application that uses the NEST library to connect to an Elasticsearch node. What happens is that after some idle time, the calls (any call) takes 1/2 seconds, while if the calls are made sequentially they are all fast (40/50ms).

Analyzing the TCP traffic, we noticed that the pod, after establishing the TCP connection (SYN,ACK-SYN,ACK) stays idle almost 1 second before sending the CLIENT\_HELLO TLS1.3 packet to Elasticsearch.

Do you know what this might be due to?

---

<div class="post-metadata">

### Author: ![LeoL](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@LeoL](https://discuss.elastic.co/u/LeoL)
#### Post date: [November 14, 2023, 11:21am UTC](https://discuss.elastic.co/t/random-slow-query-after-some-time-of-idle/346783/2 "2023-11-14T11:21:56Z")

</div>

Just for information, the problem was that we had 2 threads sharing a common resource and there was some waiting between them. One of them was the one calling elastic, so that's where the delay was.

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [November 14, 2023, 1:22pm UTC](https://discuss.elastic.co/t/random-slow-query-after-some-time-of-idle/346783/3 "2023-11-14T13:22:46Z")

</div>

Thanks for closing the loop @LeoL! That certainly sounds like it'd explain it.

---

<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 12, 2023, 1:22pm UTC](https://discuss.elastic.co/t/random-slow-query-after-some-time-of-idle/346783/4 "2023-12-12T13:22:52Z")

</div>

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