# Whether to allow the profile to be opened on every query request

**URL:** <https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540>\
**Category:** Elasticsearch\
**Created:** [February 8, 2021, 4:38am UTC](https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540 "2021-02-08T04:38:49Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![asasas234](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asasas234/32/113152_2.png) [@asasas234](https://discuss.elastic.co/u/asasas234)\
**Post date:** [February 8, 2021, 4:38am UTC](https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540/1 "2021-02-08T04:38:49Z")

</div>

I want to turn on profile for each elasticsearch query request in my system, so that I can get the profile results to print the logs, combined with traceId, I can get what the reason for each slow request is, but I am worried whether this will affect the performance of the elasticsearch query itself?

---

<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 8, 2021, 4:43am UTC](https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540/2 "2021-02-08T04:43:17Z")

</div>

Welcome to our community! 😃

Are you referring to APM profiles?

---

<div class="post-metadata">

**Author:** ![asasas234](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asasas234/32/113152_2.png) [@asasas234](https://discuss.elastic.co/u/asasas234)\
**Post date:** [February 8, 2021, 4:46am UTC](https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540/3 "2021-02-08T04:46:36Z")

</div>

> [@warkolm](#):
>
> Are you referring to APM profiles?

If there is a relevant apm can analyze es query slow in which can also be, we use is skywalking, but I did not find the relevant APM plug-in, found are elasticsearch client, and I am concerned about elasticsearch server internal slow in where. So I want to turn on Profile in every query request, so that when a slow query occurs, I can print the json of the profile section and then paste it manually into kibana to see the cause of the slowdown. But I'm not sure if this will affect the performance of the query itself, so I thought I'd ask here.

---

<div class="post-metadata">

**Author:** ![asasas234](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asasas234/32/113152_2.png) [@asasas234](https://discuss.elastic.co/u/asasas234)\
**Post date:** [February 8, 2021, 4:49am UTC](https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540/4 "2021-02-08T04:49:09Z")

</div>

```auto
GET movies/_search
{
  "query": {"match_all": {}},
  "profile": "true"
}

```

For example, in the query above, adding the profile parameter in the request body, I wonder if this will affect the performance of the query?

---

<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 8, 2021, 4:54am UTC](https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540/5 "2021-02-08T04:54:25Z")

</div>

From [Tune your queries with the Profile API | Elasticsearch Reference [7.10] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/_tune_your_queries_with_the_profile_api.html);

> - the Profile API as a debugging tool adds significant overhead to search execution and can also have a very verbose output

---

<div class="post-metadata">

**Author:** ![asasas234](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asasas234/32/113152_2.png) [@asasas234](https://discuss.elastic.co/u/asasas234)\
**Post date:** [February 8, 2021, 5:00am UTC](https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540/6 "2021-02-08T05:00:47Z")

</div>

Thanks I see, so is there any way to catch the reason for the slow request at that time? Because some requests, not every query is slow, maybe just occasionally, but I would like to know what the time is spent on?

---

<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 8, 2021, 5:02am UTC](https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540/7 "2021-02-08T05:02:07Z")

</div>

You can try looking at hot threads instead?

---

<div class="post-metadata">

**Author:** ![asasas234](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asasas234/32/113152_2.png) [@asasas234](https://discuss.elastic.co/u/asasas234)\
**Post date:** [February 8, 2021, 5:02am UTC](https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540/8 "2021-02-08T05:02:57Z")

</div>

> [@warkolm](#):
>
> You can try looking at hot threads instead?

Okay, I'll try that next time.

---

<div class="post-metadata">

**Author:** ![asasas234](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asasas234/32/113152_2.png) [@asasas234](https://discuss.elastic.co/u/asasas234)\
**Post date:** [February 8, 2021, 5:04am UTC](https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540/9 "2021-02-08T05:04:21Z")

</div>

Is there any other way to look at the hot threads in a way that doesn't feel as clear as the Profile

---

<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 8, 2021, 5:05am UTC](https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540/10 "2021-02-08T05:05:47Z")

</div>

No there's not.  
Do you have Monitoring enabled?

---

<div class="post-metadata">

**Author:** ![asasas234](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asasas234/32/113152_2.png) [@asasas234](https://discuss.elastic.co/u/asasas234)\
**Post date:** [February 8, 2021, 5:11am UTC](https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540/11 "2021-02-08T05:11:04Z")

</div>

There is monitoring, but monitoring also only looks at global level information and cannot get the reason for a particular slowdown once in a while.

---

<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 8, 2021, 5:23am UTC](https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540/12 "2021-02-08T05:23:28Z")

</div>

The only other thing is the slow log, which you can configure easily.

---

<div class="post-metadata">

**Author:** ![asasas234](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asasas234/32/113152_2.png) [@asasas234](https://discuss.elastic.co/u/asasas234)\
**Post date:** [February 8, 2021, 7:05am UTC](https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540/13 "2021-02-08T07:05:29Z")

</div>

> [@warkolm](#):
>
> The only other thing is the slow log, which you can configure easily.

Thanks, I understand that

---

<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 8, 2021, 7:05am UTC](https://discuss.elastic.co/t/whether-to-allow-the-profile-to-be-opened-on-every-query-request/263540/14 "2021-03-08T07:05:35Z")

</div>

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