# Cluster runs out of memory and service stops during index of single document

**URL:** https://discuss.elastic.co/t/cluster-runs-out-of-memory-and-service-stops-during-index-of-single-document/186083
**Category:** Elasticsearch
**Created:** [June 17, 2019, 2:13pm UTC](https://discuss.elastic.co/t/cluster-runs-out-of-memory-and-service-stops-during-index-of-single-document/186083 "2019-06-17T14:13:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kheldar](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@kheldar](https://discuss.elastic.co/u/kheldar)
#### Post date: [June 17, 2019, 2:13pm UTC](https://discuss.elastic.co/t/cluster-runs-out-of-memory-and-service-stops-during-index-of-single-document/186083/1 "2019-06-17T14:13:05Z")

</div>

Originally I mentioned this on [jessgreen thread](https://discuss.elastic.co/t/cluster-runs-out-of-memory-and-service-stops-during-re-index/185711) which is quite similar.

We use Elasticsearch 6.2.4 as our document content index with Micro Focus Content Manager. I am working to implement Content Manager as replacement for Records Manager which is the previous incarnation of the application.

I have been indexing the content of the documents in the system and have come across what appears to be a problem document. It causes out of memory errors in the Elasticsearch heap space. The document is an Excel spreadsheet 63Mb containing around 800000 rows of data

I consider our requirements for Elasticsearch to be quite modest and so I have only set up a small cluster of 2 servers with 8Gb RAM, so 4Gb heap size. Even so, 4Gb is a lot larger than 63Mb, so being new to Elasticsearch I would think that the document in question shouldn't really tax the system in this way. My reading of the Content Manager re-index log suggests that this document causes transactions to be sent around 10Mb at a time. 70Mb is sent without issue and then another 70Mb is sent with no response from Elasticsearch, with timeouts and at some point the service fails.

NB: I am using the re-indexing feature in Content Manager but in fact I am building a brand new index.

Edited: 63Mb not 63Kb. 😉

---

<div class="post-metadata">

### Author: ![kheldar](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@kheldar](https://discuss.elastic.co/u/kheldar)
#### Post date: [July 1, 2019, 3:58pm UTC](https://discuss.elastic.co/t/cluster-runs-out-of-memory-and-service-stops-during-index-of-single-document/186083/2 "2019-07-01T15:58:28Z")

</div>

Well, the obvious simple answer of increasing the RAM on the servers and reconfiguring has done the trick.  
Still not a clue how I'm supposed to make an intelligent decision about sizing. Both Content Manager and Elasticsearch are black boxes to me.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [July 1, 2019, 4:12pm UTC](https://discuss.elastic.co/t/cluster-runs-out-of-memory-and-service-stops-during-index-of-single-document/186083/3 "2019-07-01T16:12:58Z")

</div>

May I suggest you look at the following resources about sizing:

[https://www.elastic.co/elasticon/conf/2016/sf/quantitative-cluster-sizing](https://www.elastic.co/elasticon/conf/2016/sf/quantitative-cluster-sizing)

> **[How many shards should I have in my Elasticsearch cluster?](https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster)**
>
> If you are looking for practical guidelines around how many indices and shards to have in your cluster, this blog post will help you avoid common pitfalls.

https://www.slideshare.net/slideshow/embed_code/key/vR0XKDq4TGa77z

And [https://www.elastic.co/webinars/using-rally-to-get-your-elasticsearch-cluster-size-right](https://www.elastic.co/webinars/using-rally-to-get-your-elasticsearch-cluster-size-right)

---

<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 29, 2019, 4:13pm UTC](https://discuss.elastic.co/t/cluster-runs-out-of-memory-and-service-stops-during-index-of-single-document/186083/4 "2019-07-29T16:13:03Z")

</div>

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