# Auto kill queries taking more time

**URL:** <https://discuss.elastic.co/t/auto-kill-queries-taking-more-time/289775>\
**Category:** Elasticsearch\
**Created:** [November 22, 2021, 7:23am UTC](https://discuss.elastic.co/t/auto-kill-queries-taking-more-time/289775 "2021-11-22T07:23:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sreekanth](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sreekanth](https://discuss.elastic.co/u/sreekanth)\
**Post date:** [November 22, 2021, 7:23am UTC](https://discuss.elastic.co/t/auto-kill-queries-taking-more-time/289775/1 "2021-11-22T07:23:41Z")

</div>

We are using 7.3 ES. Due to few bad queries fired by end user, ES CPU/Memory jumps to very high and impacts all others. We want to know any way to stop those long-running queries and return 429 or some status, so the client can handle this.  
We got `default_search_timeout` option which is shard level timeout. And also this results in sending partial data to client. We are looking for some global end user query level settings. Also as I said, we want to return error rather partial data.

Please help us on some options to protect our cluster with these.

---

<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:** [November 22, 2021, 7:58am UTC](https://discuss.elastic.co/t/auto-kill-queries-taking-more-time/289775/2 "2021-11-22T07:58:26Z")

</div>

7.3 is [EOL](https://www.elastic.co/support/eol), please upgrade 🙂

If you upgrade you get access to a number of different improvements around this area as well!

---

<div class="post-metadata">

**Author:** ![sreekanth](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sreekanth](https://discuss.elastic.co/u/sreekanth)\
**Post date:** [November 22, 2021, 9:38am UTC](https://discuss.elastic.co/t/auto-kill-queries-taking-more-time/289775/3 "2021-11-22T09:38:37Z")

</div>

Sure thanks, planning to move to 7.8. Are there any flags or options for the same query I asked above? Overall We don't want one bad query from 1 client impacting others

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [November 22, 2021, 11:14am UTC](https://discuss.elastic.co/t/auto-kill-queries-taking-more-time/289775/4 "2021-11-22T11:14:55Z")

</div>

> [@sreekanth](#):
>
> we want to return error rather partial data.

See the query setting [allow\_partial\_results](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html#search-search-api-query-params) or the cluster setting `default_allow_partial_results`

---

<div class="post-metadata">

**Author:** ![sreekanth](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sreekanth](https://discuss.elastic.co/u/sreekanth)\
**Post date:** [November 22, 2021, 12:26pm UTC](https://discuss.elastic.co/t/auto-kill-queries-taking-more-time/289775/5 "2021-11-22T12:26:17Z")

</div>

thanks a lot. this works for us

---

<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 22, 2021, 12:47pm UTC](https://discuss.elastic.co/t/auto-kill-queries-taking-more-time/289775/6 "2021-11-22T12:47:30Z")

</div>

> [@sreekanth](#):
>
> planning to move to 7.8

7.8 is also pretty old and becomes [EOL](https://www.elastic.co/support/eol) in less than a month. It would be wise to choose something newer.

---

<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:** [November 22, 2021, 9:02pm UTC](https://discuss.elastic.co/t/auto-kill-queries-taking-more-time/289775/7 "2021-11-22T21:02:09Z")

</div>

7.15 is latest!

---

<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 20, 2021, 9:02pm UTC](https://discuss.elastic.co/t/auto-kill-queries-taking-more-time/289775/8 "2021-12-20T21:02:29Z")

</div>

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