# Getting throttled by \_msearch

**URL:** <https://discuss.elastic.co/t/getting-throttled-by-msearch/215752>\
**Category:** Elasticsearch\
**Created:** [January 20, 2020, 2:30pm UTC](https://discuss.elastic.co/t/getting-throttled-by-msearch/215752 "2020-01-20T14:30:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![doron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/doron/32/57422_2.png) [@doron](https://discuss.elastic.co/u/doron)\
**Post date:** [January 20, 2020, 2:30pm UTC](https://discuss.elastic.co/t/getting-throttled-by-msearch/215752/1 "2020-01-20T14:30:26Z")

</div>

My scenario is as follows: I want to run a very large number of queries and I want to fully utilize my cluster (40 data nodes X 16 CPUs).

I am batching my queries (400 per batch) and sending them via \_msearch, however it seems I'm getting throttled. The cluster CPUs hardly get utilized, and I simply cannot get past ~10 seconds for 400 queries, no matter how I play with the `max_concurrent_searches` and `max_concurrent_shard_requests` parameters. The `took` values per each query simply increase as I increase the concurrency, but the total time remains the same.

Any idea what I'm doing wrong here? I am using ES 6.5.3.

Thanks.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 20, 2020, 2:55pm UTC](https://discuss.elastic.co/t/getting-throttled-by-msearch/215752/2 "2020-01-20T14:55:25Z")

</div>

How large is your data set? Can it all fit in the operating system page cache? If not, it is quite possible that you are limited by disk I/O and not CPU.

---

<div class="post-metadata">

**Author:** ![doron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/doron/32/57422_2.png) [@doron](https://discuss.elastic.co/u/doron)\
**Post date:** [January 21, 2020, 5:17am UTC](https://discuss.elastic.co/t/getting-throttled-by-msearch/215752/3 "2020-01-21T05:17:17Z")

</div>

The dataset doesn't fit in memory, however I don't think I'm I/O limited here. I've been I/O limited in ES before, and usually the nodes' load factor shoot through the roof. In this case it is staying pretty idle. In addition, the very same cluster is able to reach better throughput in production, when using the regular search endpoint, so it feels like this is related to `_msearch`.

---

<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:** [February 18, 2020, 5:17am UTC](https://discuss.elastic.co/t/getting-throttled-by-msearch/215752/4 "2020-02-18T05:17:19Z")

</div>

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