# Low search query throughput and high CPU usage

**URL:** https://discuss.elastic.co/t/low-search-query-throughput-and-high-cpu-usage/11425
**Category:** Elasticsearch
**Created:** [April 3, 2013, 3:17am UTC](https://discuss.elastic.co/t/low-search-query-throughput-and-high-cpu-usage/11425 "2013-04-03T03:17:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Mike\_Kaplinskiy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike_kaplinskiy/32/1776_2.png) [@Mike\_Kaplinskiy](https://discuss.elastic.co/u/Mike_Kaplinskiy)
#### Post date: [April 3, 2013, 3:17am UTC](https://discuss.elastic.co/t/low-search-query-throughput-and-high-cpu-usage/11425/1 "2013-04-03T03:17:07Z")

</div>

Hey folks,

I'm trying to set up a small ES cluster (2x m1.xlarge machines to handle  
~4M small docs). Searches are generally low latency (\<20ms), but I can just  
barely get ~130qps without latency starting to go up and the load average  
for each machine sitting at ~10. I should also mention there is about 20qps  
of background /update requests, but without search load the cpu usage is  
minimal.

Here's what my setup looks  
like: [https://gist.github.com/anonymous/5010665a1d1f6c5a8b7c](https://gist.github.com/anonymous/5010665a1d1f6c5a8b7c) . There's no  
faceting going on and I _think_ the entire index should be in kernel cache  
(it's about 2G in size and the machine has 15G of RAM).

The reason username.parsed has such a weird analysis is for autocomplete.  
In particular, given a username of "Dwight SchRute", I want any of the  
following to match the doc:

- Dwight Schrute
- DwIght S
- rute
- schrute

but at the same time, I don't want "schrute dwight" to match. Regardless,  
removing username.parsed from the query only yields an extra ~30qps.

Is this performance expected? Did I misconfigure something?

Thanks for the help,  
Mike.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)
#### Post date: [April 3, 2013, 7:55am UTC](https://discuss.elastic.co/t/low-search-query-throughput-and-high-cpu-usage/11425/2 "2013-04-03T07:55:28Z")

</div>

You use custom script scoring which creates load. Use native custom  
script for scoring, this is more efficient.

Also, match\_phrase is not the fastest type of query compared to term  
query and match query, but I don't think it contributes much to your  
query load.

Jörg

Am 03.04.13 05:17, schrieb Mike Kaplinskiy:

> [Problematic search config · GitHub](https://gist.github.com/anonymous/5010665a1d1f6c5a8b7c)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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: [July 6, 2017, 2:43am UTC](https://discuss.elastic.co/t/low-search-query-throughput-and-high-cpu-usage/11425/3 "2017-07-06T02:43:06Z")

</div>


