# Issue with Elasticsearch performance

**URL:** <https://discuss.elastic.co/t/issue-with-elasticsearch-performance/131535>\
**Category:** Elasticsearch\
**Created:** [May 11, 2018, 9:06pm UTC](https://discuss.elastic.co/t/issue-with-elasticsearch-performance/131535 "2018-05-11T21:06:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amruth](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@amruth](https://discuss.elastic.co/u/amruth)\
**Post date:** [May 11, 2018, 9:06pm UTC](https://discuss.elastic.co/t/issue-with-elasticsearch-performance/131535/1 "2018-05-11T21:06:59Z")

</div>

Hi,

When I try to query data from ES using Kibana, I am getting Gateway Timeout. I am using Nginx as a reverse proxy(Nginx, Kibana, ES coordinating node are installed on the same server and I have 3 Data nodes with 10 different indexes with 5 Primary and 1 Replica shards each).

I suspect issue would be at ES index level and not with Kibana or Nginx. Because all other indexes are working fine without any issues, only one index is timing out.

Some of the settings I use are;

```
    `elasticsearch.requestTimeout: 900000 in kibana.yml`

    -Xms16g
    -Xmx16g in all elasticsearch.yml (RAM is 32GB on each server)

```

In Nginx error file, the error I see is,

`upstream timed out (110: Connection timed out) while reading response header from upstream, client: xxx.xx.xx, server: kibanaserver, request: "POST /elasticsearch/_msearch HTTP/1.1", upstream: "http://kibanaserver:5601/elasticsearch/_msearch", host: "kibanaserver", referrer: "http://kibanaserver/app/kibana"`

I don't see any errors in Kibana. Please let me know how to debug the issue and how to improve performance of ES.

Thanks

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 12, 2018, 3:36am UTC](https://discuss.elastic.co/t/issue-with-elasticsearch-performance/131535/2 "2018-05-12T03:36:49Z")

</div>

Does it happen without the reverse proxy?  
Do you have Monitoring from X-Pack to see what is happening at the time of the timeouts?

---

<div class="post-metadata">

**Author:** ![amruth](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@amruth](https://discuss.elastic.co/u/amruth)\
**Post date:** [May 12, 2018, 10:57am UTC](https://discuss.elastic.co/t/issue-with-elasticsearch-performance/131535/3 "2018-05-12T10:57:52Z")

</div>

I haven’t tried without reverse proxy because I can’t reach kibana without reverse proxy due to port issues.

Is there any way where I can directly query elasticsearch? Also am I missing any settings in elasticsearch? I feel like elasticsearch is utilizing more virtual memory on it’s server. Should I set mlockall to true or is it set to true by default? Please clarify..

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 12, 2018, 1:56pm UTC](https://discuss.elastic.co/t/issue-with-elasticsearch-performance/131535/4 "2018-05-12T13:56:25Z")

</div>

> [@amruth](#):
>
> elasticsearch is utilizing more virtual memory on it’s server

Elasticsearch will only ever use heap memory.

> [@amruth](#):
>
> Should I set mlockall to true or is it set to true by default?

The docs are your friends for these sorts of questions, if you can't find something let us know! [Memory lock check | Elasticsearch Reference [6.2] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/_memory_lock_check.html)

---

<div class="post-metadata">

**Author:** ![rcowart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rcowart/32/88091_2.png) [@rcowart](https://discuss.elastic.co/u/rcowart)\
**Post date:** [May 12, 2018, 3:07pm UTC](https://discuss.elastic.co/t/issue-with-elasticsearch-performance/131535/5 "2018-05-12T15:07:38Z")

</div>

By default NGiNX will timeout a connection in 60secs. You may want to look into the NGiNX config and make sure it is set to a little long than you Kibana timeouts.

---

<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:** [June 9, 2018, 3:07pm UTC](https://discuss.elastic.co/t/issue-with-elasticsearch-performance/131535/6 "2018-06-09T15:07:38Z")

</div>

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