# Search query duration record

**URL:** <https://discuss.elastic.co/t/search-query-duration-record/286271>\
**Category:** Elasticsearch\
**Created:** [October 8, 2021, 6:03pm UTC](https://discuss.elastic.co/t/search-query-duration-record/286271 "2021-10-08T18:03:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KiddoATOM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kiddoatom/32/95621_2.png) [@KiddoATOM](https://discuss.elastic.co/u/KiddoATOM)\
**Post date:** [October 8, 2021, 6:03pm UTC](https://discuss.elastic.co/t/search-query-duration-record/286271/1 "2021-10-08T18:03:21Z")

</div>

Hi. I have a problem in an ES cluster, where due to heavy search queries the cluster stops responding. I want to adjust the global search timeout and we wanted to know if there was a way to obtain the duration of each search query or how we can start recording this to use this metric to adjust the timeout time.

Thanks  
Santiago

---

<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:** [October 13, 2021, 1:12am UTC](https://discuss.elastic.co/t/search-query-duration-record/286271/2 "2021-10-13T01:12:32Z")

</div>

Welcome to our community! 😃

[Search your data | Elasticsearch Guide [7.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.15/search-your-data.html#search-timeout) has details on this, specifically;

> This global timeout duration is used if no `timeout` argument is passed in the request. If the global search timeout expires before the search request finishes, the request is cancelled using [task cancellation](https://www.elastic.co/guide/en/elasticsearch/reference/7.15/tasks.html#task-cancellation). The `search.default_search_timeout` setting defaults to `-1` (no timeout).

---

<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:** [November 10, 2021, 1:13am UTC](https://discuss.elastic.co/t/search-query-duration-record/286271/3 "2021-11-10T01:13:08Z")

</div>

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