# Slow elasticsearch results when data is big

**URL:** <https://discuss.elastic.co/t/slow-elasticsearch-results-when-data-is-big/11283>\
**Category:** Elasticsearch\
**Created:** [March 24, 2013, 1:29pm UTC](https://discuss.elastic.co/t/slow-elasticsearch-results-when-data-is-big/11283 "2013-03-24T13:29:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ophir\_Michaeli](https://avatars.discourse-cdn.com/v4/letter/o/9f8e36/32.png) [@Ophir\_Michaeli](https://discuss.elastic.co/u/Ophir_Michaeli)\
**Post date:** [March 24, 2013, 1:29pm UTC](https://discuss.elastic.co/t/slow-elasticsearch-results-when-data-is-big/11283/1 "2013-03-24T13:29:04Z")

</div>

Hi,

We're considering moving our own lucene based distributed index and search  
system to elasticsearch.

From tests I ran for 1 million indexed documents I get that elasticsearch  
is running faster, but when running tests on 26 million I get that  
elasticsearch is much slower.

I ran the 1 million and 25 million tests in the following search  
configuration: 1 machine with 1 elasticsearch http node, 4 machines with 1  
elasticsearch data node per machine (1 elasticsearch index with 2 shards  
and 2 replicas).

Thanks, Ophir

--  
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:** ![Ophir\_Michaeli](https://avatars.discourse-cdn.com/v4/letter/o/9f8e36/32.png) [@Ophir\_Michaeli](https://discuss.elastic.co/u/Ophir_Michaeli)\
**Post date:** [March 24, 2013, 3:46pm UTC](https://discuss.elastic.co/t/slow-elasticsearch-results-when-data-is-big/11283/2 "2013-03-24T15:46:17Z")

</div>

I improved elasticsearch performance in 40% by changing the java on all my  
machines to 64bit and setting the JVM memory to 8G.

On Sunday, March 24, 2013 3:29:04 PM UTC+2, Ophir Michaeli wrote:

> Hi,
> 
> We're considering moving our own lucene based distributed index and search  
> system to elasticsearch.
> 
> From tests I ran for 1 million indexed documents I get that elasticsearch  
> is running faster, but when running tests on 26 million I get that  
> elasticsearch is much slower.
> 
> I ran the 1 million and 25 million tests in the following search  
> configuration: 1 machine with 1 elasticsearch http node, 4 machines with 1  
> elasticsearch data node per machine (1 elasticsearch index with 2 shards  
> and 2 replicas).
> 
> Thanks, Ophir

--  
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:** ![Ophir\_Michaeli](https://avatars.discourse-cdn.com/v4/letter/o/9f8e36/32.png) [@Ophir\_Michaeli](https://discuss.elastic.co/u/Ophir_Michaeli)\
**Post date:** [March 24, 2013, 5:14pm UTC](https://discuss.elastic.co/t/slow-elasticsearch-results-when-data-is-big/11283/3 "2013-03-24T17:14:05Z")

</div>

A search of 100 words takes 3m:48s if the max returned results are 2000 per  
search word, while this run time drops to only 12 seconds if the max  
returned results is 20 per search word.

On Sunday, March 24, 2013 3:29:04 PM UTC+2, Ophir Michaeli wrote:

> Hi,
> 
> We're considering moving our own lucene based distributed index and search  
> system to elasticsearch.
> 
> From tests I ran for 1 million indexed documents I get that elasticsearch  
> is running faster, but when running tests on 26 million I get that  
> elasticsearch is much slower.
> 
> I ran the 1 million and 25 million tests in the following search  
> configuration: 1 machine with 1 elasticsearch http node, 4 machines with 1  
> elasticsearch data node per machine (1 elasticsearch index with 2 shards  
> and 2 replicas).
> 
> Thanks, Ophir

--  
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:** ![Ophir\_Michaeli](https://avatars.discourse-cdn.com/v4/letter/o/9f8e36/32.png) [@Ophir\_Michaeli](https://discuss.elastic.co/u/Ophir_Michaeli)\
**Post date:** [March 25, 2013, 9:06am UTC](https://discuss.elastic.co/t/slow-elasticsearch-results-when-data-is-big/11283/4 "2013-03-25T09:06:14Z")

</div>

Same search of 100 words with Lucene takes 55s if the max returned results  
are 2000 (while it takes 3m:48s in elasticsearch).

On Sunday, March 24, 2013 3:29:04 PM UTC+2, Ophir Michaeli wrote:

> Hi,
> 
> We're considering moving our own lucene based distributed index and search  
> system to elasticsearch.
> 
> From tests I ran for 1 million indexed documents I get that elasticsearch  
> is running faster, but when running tests on 26 million I get that  
> elasticsearch is much slower.
> 
> I ran the 1 million and 25 million tests in the following search  
> configuration: 1 machine with 1 elasticsearch http node, 4 machines with 1  
> elasticsearch data node per machine (1 elasticsearch index with 2 shards  
> and 2 replicas).
> 
> Thanks, Ophir

--  
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:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [March 25, 2013, 9:31am UTC](https://discuss.elastic.co/t/slow-elasticsearch-results-when-data-is-big/11283/5 "2013-03-25T09:31:33Z")

</div>

to be honest 55 seconds is not acceptable for 100 terms even in plain  
lucene. can you explain your usecase a bit. this sounds odd.  
Also what does 100 words query mean, disjunction / conjunction? are you  
paging deeply, how many shards are you using, which fetch method / search  
type?  
simon

On Monday, March 25, 2013 10:06:14 AM UTC+1, Ophir Michaeli wrote:

> Same search of 100 words with Lucene takes 55s if the max returned results  
> are 2000 (while it takes 3m:48s in elasticsearch).
> 
> On Sunday, March 24, 2013 3:29:04 PM UTC+2, Ophir Michaeli wrote:
> 
> > Hi,
> > 
> > We're considering moving our own lucene based distributed index and  
> > search system to elasticsearch.
> > 
> > From tests I ran for 1 million indexed documents I get that elasticsearch  
> > is running faster, but when running tests on 26 million I get that  
> > elasticsearch is much slower.
> > 
> > I ran the 1 million and 25 million tests in the following search  
> > configuration: 1 machine with 1 elasticsearch http node, 4 machines with 1  
> > elasticsearch data node per machine (1 elasticsearch index with 2 shards  
> > and 2 replicas).
> > 
> > Thanks, Ophir

--  
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:** ![Ophir\_Michaeli](https://avatars.discourse-cdn.com/v4/letter/o/9f8e36/32.png) [@Ophir\_Michaeli](https://discuss.elastic.co/u/Ophir_Michaeli)\
**Post date:** [March 25, 2013, 12:09pm UTC](https://discuss.elastic.co/t/slow-elasticsearch-results-when-data-is-big/11283/6 "2013-03-25T12:09:08Z")

</div>

The lucene test has the following configuration: 26 million indexed  
documents divided into 2 lucene instances and searched at the same time.

100 words search means each word is searched separately. No paging.

For the elasticsearch test I use 2 shards and 2 replicas.

The json is something like this:

[http://localhost:9200/pinterest\_index/\_search](http://localhost:9200/pinterest_index/_search)

{

"size": 2000,

"query": {

```
"query_string": {

  "query": "air",

  "fields": [

    "board^5",

    "user^1",

    "description^10"

  ],

  "analyzer": "snowball",

  "phrase_slop": 1000.0

}

```

},

"fields": [

```
"iDPin",

"iDPicture"

```

]

}

Thanks!  
On Sunday, March 24, 2013 3:29:04 PM UTC+2, Ophir Michaeli wrote:

> Hi,
> 
> We're considering moving our own lucene based distributed index and search  
> system to elasticsearch.
> 
> From tests I ran for 1 million indexed documents I get that elasticsearch  
> is running faster, but when running tests on 26 million I get that  
> elasticsearch is much slower.
> 
> I ran the 1 million and 25 million tests in the following search  
> configuration: 1 machine with 1 elasticsearch http node, 4 machines with 1  
> elasticsearch data node per machine (1 elasticsearch index with 2 shards  
> and 2 replicas).
> 
> Thanks, Ophir

--  
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:** ![Ophir\_Michaeli](https://avatars.discourse-cdn.com/v4/letter/o/9f8e36/32.png) [@Ophir\_Michaeli](https://discuss.elastic.co/u/Ophir_Michaeli)\
**Post date:** [April 1, 2013, 11:40am UTC](https://discuss.elastic.co/t/slow-elasticsearch-results-when-data-is-big/11283/7 "2013-04-01T11:40:40Z")

</div>

I improved the time dramatically by moving from a client that uses 1 thread  
to 50 threads.

Now a 100 words search on 26 million indexed words takes 9 seconds using  
elasticsearch (4 nodes, 2 shards, 2 replicas).

On Sunday, March 24, 2013 3:29:04 PM UTC+2, Ophir Michaeli wrote:

> Hi,
> 
> We're considering moving our own lucene based distributed index and search  
> system to elasticsearch.
> 
> From tests I ran for 1 million indexed documents I get that elasticsearch  
> is running faster, but when running tests on 26 million I get that  
> elasticsearch is much slower.
> 
> I ran the 1 million and 25 million tests in the following search  
> configuration: 1 machine with 1 elasticsearch http node, 4 machines with 1  
> elasticsearch data node per machine (1 elasticsearch index with 2 shards  
> and 2 replicas).
> 
> Thanks, Ophir

--  
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/slow-elasticsearch-results-when-data-is-big/11283/8 "2017-07-06T02:43:24Z")

</div>


