# Elasticsearch First Response is very slow

**URL:** <https://discuss.elastic.co/t/elasticsearch-first-response-is-very-slow/164245>\
**Category:** Elasticsearch\
**Created:** [January 15, 2019, 6:21am UTC](https://discuss.elastic.co/t/elasticsearch-first-response-is-very-slow/164245 "2019-01-15T06:21:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nuwancs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nuwancs/32/46419_2.png) [@nuwancs](https://discuss.elastic.co/u/nuwancs)\
**Post date:** [January 15, 2019, 6:21am UTC](https://discuss.elastic.co/t/elasticsearch-first-response-is-very-slow/164245/1 "2019-01-15T06:21:04Z")

</div>

I have 7 days of data in 3 node cluster. 1 shard per index with one segment. I am planning to have data for 90 days later.  
I try to view data for last 90 days(only 7 days of data really available) using date picker in kibana.  
i start with clearing the cache.  
Initial load take 70 seconds and then when i use the same time range took time goes to 4ms.  
when change the time range again first call take over 1 min and goes below 1 second when i do the same search again.

How can I improve this?

Other info:  
Es, kibana - 6.3.0  
3 nodes with 4core 15gb with 7gb assigned to heap  
index size is 2.2gb and has one replica

9 visualizations in the dashboard

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 15, 2019, 7:07am UTC](https://discuss.elastic.co/t/elasticsearch-first-response-is-very-slow/164245/2 "2019-01-15T07:07:38Z")

</div>

What kind of server/hardware is this deployed on? How many visualisations does your dashboard have?

---

<div class="post-metadata">

**Author:** ![nuwancs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nuwancs/32/46419_2.png) [@nuwancs](https://discuss.elastic.co/u/nuwancs)\
**Post date:** [January 15, 2019, 7:10am UTC](https://discuss.elastic.co/t/elasticsearch-first-response-is-very-slow/164245/3 "2019-01-15T07:10:16Z")

</div>

Google cloud  
n1-standard-4 (4 vCPUs, 15 GB memory)

Disk  
400GB per node  
Standard persistent disk

CentOS

9 visualizations in the dashboard

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 15, 2019, 7:27am UTC](https://discuss.elastic.co/t/elasticsearch-first-response-is-very-slow/164245/4 "2019-01-15T07:27:49Z")

</div>

So you have 14 shards in the cluster and only around 15GB of data? What is the output of the [cluster stats API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html)? Are you indexing at the same time you are querying? Do you have anything else running on these nodes?

---

<div class="post-metadata">

**Author:** ![nuwancs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nuwancs/32/46419_2.png) [@nuwancs](https://discuss.elastic.co/u/nuwancs)\
**Post date:** [January 15, 2019, 7:30am UTC](https://discuss.elastic.co/t/elasticsearch-first-response-is-very-slow/164245/5 "2019-01-15T07:30:10Z")

</div>

I don't do any indexing at the moment. Nothing else is running on this cluster.  
Now I have 18 shards as I added 3 indexes in the mean time.

cluster stats API Output

> {  
> "\_nodes": {  
> "total": 3,  
> "successful": 3,  
> "failed": 0  
> },  
> "cluster\_name": "nuwans-elk-cluster1",  
> "timestamp": 1547537312699,  
> "status": "green",  
> "indices": {  
> "count": 24,  
> "shards": {  
> "total": 48,  
> "primaries": 24,  
> "replication": 1,  
> "index": {  
> "shards": {  
> "min": 2,  
> "max": 2,  
> "avg": 2  
> },  
> "primaries": {  
> "min": 1,  
> "max": 1,  
> "avg": 1  
> },  
> "replication": {  
> "min": 1,  
> "max": 1,  
> "avg": 1  
> }  
> }  
> },  
> "docs": {  
> "count": 490350031,  
> "deleted": 26139547  
> },  
> "store": {  
> "size": "43.7gb",  
> "size\_in\_bytes": 46980963876  
> },  
> "fielddata": {  
> "memory\_size": "57.7kb",  
> "memory\_size\_in\_bytes": 59104,  
> "evictions": 0  
> },  
> "query\_cache": {  
> "memory\_size": "0b",  
> "memory\_size\_in\_bytes": 0,  
> "total\_count": 0,  
> "hit\_count": 0,  
> "miss\_count": 0,  
> "cache\_size": 0,  
> "cache\_count": 0,  
> "evictions": 0  
> },  
> "completion": {  
> "size": "0b",  
> "size\_in\_bytes": 0  
> },  
> "segments": {  
> "count": 442,  
> "memory": "324.4mb",  
> "memory\_in\_bytes": 340159639,  
> "terms\_memory": "278.6mb",  
> "terms\_memory\_in\_bytes": 292200192,  
> "stored\_fields\_memory": "29.4mb",  
> "stored\_fields\_memory\_in\_bytes": 30931216,  
> "term\_vectors\_memory": "0b",  
> "term\_vectors\_memory\_in\_bytes": 0,  
> "norms\_memory": "4.8kb",  
> "norms\_memory\_in\_bytes": 4992,  
> "points\_memory": "14.2mb",  
> "points\_memory\_in\_bytes": 14893247,  
> "doc\_values\_memory": "2mb",  
> "doc\_values\_memory\_in\_bytes": 2129992,  
> "index\_writer\_memory": "0b",  
> "index\_writer\_memory\_in\_bytes": 0,  
> "version\_map\_memory": "0b",  
> "version\_map\_memory\_in\_bytes": 0,  
> "fixed\_bit\_set": "0b",  
> "fixed\_bit\_set\_memory\_in\_bytes": 0,  
> "max\_unsafe\_auto\_id\_timestamp": 1547510407937,  
> "file\_sizes": {}  
> }  
> },  
> "nodes": {  
> "count": {  
> "total": 3,  
> "data": 3,  
> "coordinating\_only": 0,  
> "master": 3,  
> "ingest": 3  
> },  
> "versions": [  
> "6.3.0"  
> ],  
> "os": {  
> "available\_processors": 12,  
> "allocated\_processors": 12,  
> "names": [  
> {  
> "name": "Linux",  
> "count": 3  
> }  
> ],  
> "mem": {  
> "total": "43.5gb",  
> "total\_in\_bytes": 46799904768,  
> "free": "1.1gb",  
> "free\_in\_bytes": 1190825984,  
> "used": "42.4gb",  
> "used\_in\_bytes": 45609078784,  
> "free\_percent": 3,  
> "used\_percent": 97  
> }  
> },  
> "process": {  
> "cpu": {  
> "percent": 17  
> },  
> "open\_file\_descriptors": {  
> "min": 344,  
> "max": 366,  
> "avg": 351  
> }  
> },  
> "jvm": {  
> "max\_uptime": "9d",  
> "max\_uptime\_in\_millis": 781731013,  
> "versions": [  
> {  
> "version": "1.8.0\_191",  
> "vm\_name": "OpenJDK 64-Bit Server VM",  
> "vm\_version": "25.191-b12",  
> "vm\_vendor": "Oracle Corporation",  
> "count": 3  
> }  
> ],  
> "mem": {  
> "heap\_used": "9.8gb",  
> "heap\_used\_in\_bytes": 10625182904,  
> "heap\_max": "20.9gb",  
> "heap\_max\_in\_bytes": 22443982848  
> },  
> "threads": 243  
> },  
> "fs": {  
> "total": "1.1tb",  
> "total\_in\_bytes": 1288439058432,  
> "free": "1.1tb",  
> "free\_in\_bytes": 1223634808832,  
> "available": "1.1tb",  
> "available\_in\_bytes": 1223634808832  
> },  
> "plugins": ,  
> "network\_types": {  
> "transport\_types": {  
> "security4": 3  
> },  
> "http\_types": {  
> "security4": 3  
> }  
> }  
> }  
> }

---

<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:** [February 12, 2019, 7:30am UTC](https://discuss.elastic.co/t/elasticsearch-first-response-is-very-slow/164245/6 "2019-02-12T07:30:24Z")

</div>

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