# ElasticSearch Query time - how to decrease the response time

**URL:** <https://discuss.elastic.co/t/elasticsearch-query-time-how-to-decrease-the-response-time/27681>\
**Category:** Elasticsearch\
**Created:** [August 19, 2015, 2:37pm UTC](https://discuss.elastic.co/t/elasticsearch-query-time-how-to-decrease-the-response-time/27681 "2015-08-19T14:37:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![puneetm](https://avatars.discourse-cdn.com/v4/letter/p/e480ec/32.png) [@puneetm](https://discuss.elastic.co/u/puneetm)\
**Post date:** [August 19, 2015, 2:37pm UTC](https://discuss.elastic.co/t/elasticsearch-query-time-how-to-decrease-the-response-time/27681/1 "2015-08-19T14:37:01Z")

</div>

Hi,

I am a newbie to elasticsearch. I am executing some queries on elastic search.  
Some of the queries are taking long time to execute first time and on rerun response time reduces.

However, first time execution is nearing 16 secs for some of the queries.

I have increased the vCPU from 1vCPU to 2vCPU (ElasticSearch server  
is running as a VM) and I can see certain decrease in the response time  
("took" in elastic search).

All the other settings are default except I have set the ES\_HEAP\_SIZE to 4g.

Can someone please help and summarize, what all factors (both  
hardware and software e.g. query construct) affect the response time in  
ElasticSearch. I am using 8GB RAM

I am using Java to query ES.

Thanks,  
Puneet

---

<div class="post-metadata">

**Author:** ![artursmet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/artursmet/32/4219_2.png) [@artursmet](https://discuss.elastic.co/u/artursmet)\
**Post date:** [August 19, 2015, 3:46pm UTC](https://discuss.elastic.co/t/elasticsearch-query-time-how-to-decrease-the-response-time/27681/2 "2015-08-19T15:46:08Z")

</div>

Hi,

Please share some queries that you're executing and tell something about your data design.

Artur

---

<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 5, 2017, 11:54pm UTC](https://discuss.elastic.co/t/elasticsearch-query-time-how-to-decrease-the-response-time/27681/3 "2017-07-05T23:54:57Z")

</div>


