# Throttling search requests

**URL:** <https://discuss.elastic.co/t/throttling-search-requests/69227>\
**Category:** Elasticsearch\
**Created:** [December 16, 2016, 12:12am UTC](https://discuss.elastic.co/t/throttling-search-requests/69227 "2016-12-16T00:12:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![animageofmine](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@animageofmine](https://discuss.elastic.co/u/animageofmine)\
**Post date:** [December 16, 2016, 12:12am UTC](https://discuss.elastic.co/t/throttling-search-requests/69227/1 "2016-12-16T00:12:25Z")

</div>

1. What is the best practice to throttle search requests? Does Elasticsearch provide any configurations to throttle search requests?

2. Is there a way to prioritize different types of queries (e.g. prioritize search over indexing)?

3. If throttling is available, is it specific to index, or is that a global configuration/setting?

We have load balancing via consul and I was able to find a way to throttle merge (indexing), but nothing for search. Before we write our own token bucket/throttling algorithm, wanted to check if there was something we can leverage. Thank you in advance.

---

<div class="post-metadata">

**Author:** ![DiscussBuster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/discussbuster/32/11042_2.png) [@DiscussBuster](https://discuss.elastic.co/u/DiscussBuster)\
**Post date:** [December 16, 2016, 6:27am UTC](https://discuss.elastic.co/t/throttling-search-requests/69227/2 "2016-12-16T06:27:20Z")

</div>

None of these are possible.

---

<div class="post-metadata">

**Author:** ![animageofmine](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@animageofmine](https://discuss.elastic.co/u/animageofmine)\
**Post date:** [December 16, 2016, 4:33pm UTC](https://discuss.elastic.co/t/throttling-search-requests/69227/3 "2016-12-16T16:33:26Z")

</div>

Thank you. I think there is a way to deal with it, not a real throttler, but still one possible way:

Update the queue size for fixed queue based on the amount of load that you want the node to handle. This might help a bit.

---

<div class="post-metadata">

**Author:** ![DiscussBuster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/discussbuster/32/11042_2.png) [@DiscussBuster](https://discuss.elastic.co/u/DiscussBuster)\
**Post date:** [December 16, 2016, 6:40pm UTC](https://discuss.elastic.co/t/throttling-search-requests/69227/4 "2016-12-16T18:40:46Z")

</div>

Yeah, that occurred to me, but I wouldn't consider suddenly rejecting searches to be a deterministic throttle. Moreover, it very much doesn't come close to any of the criteria you detailed, and that will affect all users, all indices, all types.

---

<div class="post-metadata">

**Author:** ![animageofmine](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@animageofmine](https://discuss.elastic.co/u/animageofmine)\
**Post date:** [December 16, 2016, 7:00pm UTC](https://discuss.elastic.co/t/throttling-search-requests/69227/5 "2016-12-16T19:00:22Z")

</div>

Agreed. We will probably create our own throttler unless you have suggestions (if there is something opensource available in the market that other clients already use)

---

<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:** [January 13, 2017, 7:00pm UTC](https://discuss.elastic.co/t/throttling-search-requests/69227/6 "2017-01-13T19:00:22Z")

</div>

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