# Elastic Search Query performance problem

**URL:** https://discuss.elastic.co/t/elastic-search-query-performance-problem/18623
**Category:** Elasticsearch
**Created:** [July 12, 2014, 3:07pm UTC](https://discuss.elastic.co/t/elastic-search-query-performance-problem/18623 "2014-07-12T15:07:55Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nnikolay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nnikolay/32/73361_2.png) [@nnikolay](https://discuss.elastic.co/u/nnikolay)
#### Post date: [July 12, 2014, 3:07pm UTC](https://discuss.elastic.co/t/elastic-search-query-performance-problem/18623/1 "2014-07-12T15:07:55Z")

</div>

Hi, all we have switched from Sphinx to ElasticSearch, but we have big performance troubles. In Sphinx with the same amount of data we had response times between: 50ms - 70ms . Now our response times are very high: 300-500ms.

I am sending you the configs and settings of all we have. Can you please take a look and help us to become again response times under 70ms ?

If you want some other info, please write me:

------------ settings and OS env. --------------

ES Settings:

2 Nodes on 2 different hosts

Each index has 1 primary shard we have 2 shards each index

3,762 Total Shards

3,762 Successful Shards

85 Indices

20,347,989 Documents

40.5GB Size

\<nabble\_img src="ES.png" border="0"/\>

elasticsearch.yml

index.cache.field.type: soft

indices.cache.filter.size: 50%

index.fielddata.cache: soft

index.cache.field.expire: 60m

indices.fielddata.cache.size: 50%

indices.fielddata.cache.expire : 60m

index.store.type: mmapfs

transport.tcp.compress: true;

bootstrap.mlockall: true

index.search.slowlog.threshold.query.warn: 10s

index.search.slowlog.threshold.query.info: 5s

index.search.slowlog.threshold.query.debug: 2s

index.search.slowlog.threshold.query.trace: 500ms

Example: We have an index for the Country DE and there are 1,5M documents. This index has 2 shards.

Starting of ES:

/usr/lib/jvm/java-7-openjdk-amd64//bin/java -Xms32g -Xmx32g -Xss256k -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.pidfile=/var/run/elasticsearch.pid -Des.path.home=/usr/share/elasticsearch -cp :/usr/share/elasticsearch/lib/elasticsearch-1.1.2.jar:/usr/share/elasticsearch/lib/:/usr/share/elasticsearch/lib/sigar/ -Des.default.config=/etc/elasticsearch/elasticsearch.yml -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=/var/log/elasticsearch -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch -Des.default.path.conf=/etc/elasticsearch org.elasticsearch.bootstrap.Elasticsearch

OS:

24 Cores

80 GB of RAM

60 GB are used

Disk space: 1,2 TB

350 GB used / 780GB free

Disc type: SAS

Mysql is running also on this machine

Example Query: search for some City, where we give to ES the location\_id:

{"query":{"multi\_match":{"query":"faviczer":"indexAnalyzer","tie\_breaker":0.3,"fuzziness":2,"operator":"or"}},"sort":{"ad\_time\_priority":{"order":"desc"},"price":{"order":"desc"},"order\_priority":{"order":"desc"},"\_score":{"order":"desc"}},"facets":{"company\_id":{"facet\_filter":{"bool":{"must":[{"terms":{"sponsored":[1,0]}},{"not":{"filter":{"terms":{"job\_source\_id":[188]}}}}]}},"terms":{"field":"company\_facet","order":"count","script":"doc['company\_facet'].value + '|' + doc['company\_id'].value"}},"job\_type\_id":{"facet\_filter":{"bool":{"must":[{"terms":{"sponsored":[1,0]}},{"not":{"filter":{"terms":{"job\_source\_id":[188]}}}}]}},"terms":{"field":"jobtype\_facet","order":"term","all\_terms":true}}},"filter":{"bool":{"must":[{"terms":{"sponsored":[1,0]}},{"not":{"filter":{"terms":{"job\_source\_id":[188]}}}}]}},"size":10,"from":0,"explain":false,"highlight":{"order":"score","require\_field\_match":false,"pre\_tags":["**"],"post\_tags":["\</b\>"],"fields":{"description":{"type":"fvh","force\_source":true,"no\_match\_size":200,"index\_options":"offsets","fragment\_size":200,"number\_of\_fragments":2,"matched\_fields":["description","title"]}}}}**

Response time on this query: \> 400ms .. what is very very slow. We have disabled the facetes as well, but nothing has changed.

Thanks Nik

---

<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, 1:16am UTC](https://discuss.elastic.co/t/elastic-search-query-performance-problem/18623/2 "2017-07-06T01:16:18Z")

</div>


