# How to track down slow queries?

**URL:** <https://discuss.elastic.co/t/how-to-track-down-slow-queries/167040>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring\
**Created:** [February 4, 2019, 10:54pm UTC](https://discuss.elastic.co/t/how-to-track-down-slow-queries/167040 "2019-02-04T22:54:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpm1984](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rpm1984/32/36595_2.png) [@rpm1984](https://discuss.elastic.co/u/rpm1984)\
**Post date:** [February 4, 2019, 10:54pm UTC](https://discuss.elastic.co/t/how-to-track-down-slow-queries/167040/1 "2019-02-04T22:54:19Z")

</div>

Hi there,

I'm using ElasticCloud to host ES.

I'm seeing 'some' slow requests coming from my Azure Web App talking to my ES cluster.

Setup:

- Azure web app: Azure East (Sydney)
- ES cluster: AWS Sydney, 1 node, 1 primary shard, 0 replicas (yes.. i know not ideal, but this is just a dev/test cluster)

So we're talking 15ms of latency between Azure and AWS.

99% of requests are \< 50ms.. but all of a sudden i get a bit of a spike that lasts a couple of minutes.

Here's an example from ApplicationInsights in Azure:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/1/e1dd344f9db7327e22057593f5eeee65d54935b9.png)

So that's saying it took 914ms to do the network call.

However, in Kibana.. i can't see this request at all.

I'm looking at the 'Search Latency' under 'Overview'.. and would expect to find a spike there.. but it never goes above 0.36ms.

Given the network latency is \< 50ms.. something is happening.. either a network blip, or something on the ES side.

Maybe it's not the _query_ that's slow.. but something before/after that? (for example: maybe connecting to all the nodes, getting results etc)?.

Any tips on tracking down these slow requests? Is there another place i can look in Kibana? (note: i can't use slowlog.. as that's not supported by ElasticCloud)

Thanks!

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [February 6, 2019, 12:55am UTC](https://discuss.elastic.co/t/how-to-track-down-slow-queries/167040/2 "2019-02-06T00:55:06Z")

</div>

Are you making the requests from Azure web app with NEST?

If so, would be worth enabling network tracing, to see where time is being spent: [https://docs.microsoft.com/en-us/dotnet/framework/network-programming/network-tracing](https://docs.microsoft.com/en-us/dotnet/framework/network-programming/network-tracing)

This should some insight into whether there's something related to the network, or not.

---

<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 6, 2019, 12:55am UTC](https://discuss.elastic.co/t/how-to-track-down-slow-queries/167040/3 "2019-03-06T00:55:08Z")

</div>

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