# Slow search query issue \[5.5\]

**URL:** <https://discuss.elastic.co/t/slow-search-query-issue-5-5/97420>\
**Category:** Elasticsearch\
**Created:** [August 17, 2017, 1:10pm UTC](https://discuss.elastic.co/t/slow-search-query-issue-5-5/97420 "2017-08-17T13:10:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![akubasa](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@akubasa](https://discuss.elastic.co/u/akubasa)\
**Post date:** [August 17, 2017, 1:10pm UTC](https://discuss.elastic.co/t/slow-search-query-issue-5-5/97420/1 "2017-08-17T13:10:09Z")

</div>

Dear Elastic community

We are struggling with very slow search querys. We have ~ 10 Mio documents and 140 Shards on one node. Elasticsearch is running on 7GB Ram and 2cores.

Each first request takes up to 15 seconds. Here an example request with profile information:

[https://pastebin.com/FUv6rvT7](https://pastebin.com/FUv6rvT7)

Here the result:

[https://pastebin.com/jTiPMBce](https://pastebin.com/jTiPMBce)

Here the mapping:

[https://pastebin.com/EvpzxB5y](https://pastebin.com/EvpzxB5y)

---

<div class="post-metadata">

**Author:** ![aholbreich](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@aholbreich](https://discuss.elastic.co/u/aholbreich)\
**Post date:** [August 17, 2017, 7:27pm UTC](https://discuss.elastic.co/t/slow-search-query-issue-5-5/97420/2 "2017-08-17T19:27:26Z")

</div>

Hi, i'm also relative new to Elastic Search but i can already tell you that

> 140 Shards on **one node**.

sounds like a bad idea. Every shard is Lucene engine. So if your query needs to go though all 140 on one node might be that this is the problem and in result less fast, than having one, two or 3 shards.

---

<div class="post-metadata">

**Author:** ![akubasa](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@akubasa](https://discuss.elastic.co/u/akubasa)\
**Post date:** [August 17, 2017, 7:47pm UTC](https://discuss.elastic.co/t/slow-search-query-issue-5-5/97420/3 "2017-08-17T19:47:41Z")

</div>

We reduced shard size to 1 on the slow index. Before it was 5 and 5 unassigned. Now, with only 1 shard, it seems to be even slower than with 5 shards.

Sorry.

---

<div class="post-metadata">

**Author:** ![aholbreich](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@aholbreich](https://discuss.elastic.co/u/aholbreich)\
**Post date:** [August 18, 2017, 8:50am UTC](https://discuss.elastic.co/t/slow-search-query-issue-5-5/97420/4 "2017-08-18T08:50:20Z")

</div>

Ok 1 and 5 maybe makes no difference. But i was woundering bout 140...  
I can't help you with the query, since i'm also just started with ES and have no experience

---

<div class="post-metadata">

**Author:** ![akubasa](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@akubasa](https://discuss.elastic.co/u/akubasa)\
**Post date:** [August 20, 2017, 2:05pm UTC](https://discuss.elastic.co/t/slow-search-query-issue-5-5/97420/5 "2017-08-20T14:05:02Z")

</div>

Any further suggestions?

Query is fast below 1 Mio documents. 1Mio+ its getting slower and slower.

---

<div class="post-metadata">

**Author:** ![akubasa](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@akubasa](https://discuss.elastic.co/u/akubasa)\
**Post date:** [August 25, 2017, 2:50pm UTC](https://discuss.elastic.co/t/slow-search-query-issue-5-5/97420/6 "2017-08-25T14:50:02Z")

</div>

So just a summary from our environment

Server:  
24GB RAM  
2 cores  
100GB hdd

12GB RAM for elastic  
all production settings were made like mlockall, etc.

13GB total documents in index  
2 shards assigned for index

In favor of speed we removed the match for description in our query.

are there any values you need to know from kibana?  
any suggestions what to investigate to find the issue

search speed, no matter what the input is under 3 mio documents ~20ms (constant)  
search speed for 10 mio documents ~12000ms for the first query

afterwards (when elastic cached the search) it is around 500ms

I Hope anyone can help.

---

<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:** [September 22, 2017, 2:50pm UTC](https://discuss.elastic.co/t/slow-search-query-issue-5-5/97420/7 "2017-09-22T14:50:04Z")

</div>

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