# Optimizing a single node ES instance for throughput

**URL:** https://discuss.elastic.co/t/optimizing-a-single-node-es-instance-for-throughput/307808
**Category:** Elasticsearch
**Created:** [June 21, 2022, 10:22pm UTC](https://discuss.elastic.co/t/optimizing-a-single-node-es-instance-for-throughput/307808 "2022-06-21T22:22:05Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![dmh43](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@dmh43](https://discuss.elastic.co/u/dmh43)
#### Post date: [June 21, 2022, 10:22pm UTC](https://discuss.elastic.co/t/optimizing-a-single-node-es-instance-for-throughput/307808/1 "2022-06-21T22:22:05Z")

</div>

I have a single large (500GB ram and 128 cores) machine that I have indexed a corpus of around 1TB in size. The documents vary in length, from very short (~100 characters) to very long (a single documents that is \> 100 MB in size).

Requests to the index arrive as part of a batch process, so I do not have strict requirements on latency, I mostly want to maximize retrieval throughput (I rarely index new documents).

My index has 50 shards, and requests are made to the index using multiple connections. I'm finding that if I have too many connections open, then I get `ScanError: Scroll request has only succeeded on 25 (+0 skiped) shards out of 50` even though the machine does not seem particularly loaded. If I do not open enough connections, then the machine is mostly idle and throughput is low. I'm finding that the optimal number of connections depends on the queries I am making.

My questions:

- Why am I getting the `ScanError` reported above? Is there some way to get some details as to what caused certain shards to not succeed? Do I just need to increase the number of shards?
- Do you have any other suggestions when it comes to optimizing throughput for a single node cluster? Or even for ES clusters in general.
- Is there some better way to choose the number of connections?

---

<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: [June 21, 2022, 10:30pm UTC](https://discuss.elastic.co/t/optimizing-a-single-node-es-instance-for-throughput/307808/2 "2022-06-21T22:30:22Z")

</div>

Welcome to our community! 😃

You'd be better off splitting this host up into a few nodes. You're already running risk of losing data due to being on a single host, but a few nodes (eg 3) would probably make better use of the overall resources.

---

<div class="post-metadata">

### Author: ![dmh43](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@dmh43](https://discuss.elastic.co/u/dmh43)
#### Post date: [June 22, 2022, 2:22pm UTC](https://discuss.elastic.co/t/optimizing-a-single-node-es-instance-for-throughput/307808/3 "2022-06-22T14:22:01Z")

</div>

Thanks! Why would spinning up additional nodes make better use of the computational resources? I would expect that there is some configurations I can change to allow a single node to take advantage of all it's resources.

---

<div class="post-metadata">

### Author: ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)
#### Post date: [June 22, 2022, 5:47pm UTC](https://discuss.elastic.co/t/optimizing-a-single-node-es-instance-for-throughput/307808/4 "2022-06-22T17:47:13Z")

</div>

Look for articles like this: [Running Multiple Elasticsearch 6.x Instances on a Single Server](https://eitr.tech/blog/2019/01/17/multiple-es-nodes-single-server.html)

Java heap is limited to about 32G for best performance because it's Java, so multiple instances let you have more heap.

Anyone running in a cloud resource is highly likely to be sharing a host.

---

<div class="post-metadata">

### Author: ![sandeepkanabar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandeepkanabar/32/79399_2.png) [@sandeepkanabar](https://discuss.elastic.co/u/sandeepkanabar)
#### Post date: [June 30, 2022, 6:20am UTC](https://discuss.elastic.co/t/optimizing-a-single-node-es-instance-for-throughput/307808/5 "2022-06-30T06:20:46Z")

</div>

> [@dmh43](#):
>
> I have a single large (500GB ram

Because the max recommended ES heap size is 32 GB. See this - [Use more than 32GB for heap - #2 by spinscale](https://discuss.elastic.co/t/use-more-than-32gb-for-heap/204422/2). So in effect, you aren't able to fully utilise the full RAM.

So you can either set up multiple instances or you can set-up multiple VM (nodes). cost-wise it would actually work out lesser for you.

Also have a look at [Managing and troubleshooting Elasticsearch memory | Elastic Blog](https://www.elastic.co/blog/managing-and-troubleshooting-elasticsearch-memory)

---

<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: [June 30, 2022, 7:03am UTC](https://discuss.elastic.co/t/optimizing-a-single-node-es-instance-for-throughput/307808/6 "2022-06-30T07:03:57Z")

</div>

> [@sandeepkanabar](#):
>
> Because the max recommended ES heap size is 32 GB. See this - [Use more than 32GB for heap - #2 by spinscale](https://discuss.elastic.co/t/use-more-than-32gb-for-heap/204422/2). So in effect, you aren't able to fully utilise the full RAM.

That's not 100% accurate. Because the OS will cache commonly used files - by Elasticsearch - in any free memory.

---

<div class="post-metadata">

### Author: ![sandeepkanabar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandeepkanabar/32/79399_2.png) [@sandeepkanabar](https://discuss.elastic.co/u/sandeepkanabar)
#### Post date: [June 30, 2022, 9:41am UTC](https://discuss.elastic.co/t/optimizing-a-single-node-es-instance-for-throughput/307808/7 "2022-06-30T09:41:50Z")

</div>

Ah, thanks for clarifying, Mark 👍

---

<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 28, 2022, 9:42am UTC](https://discuss.elastic.co/t/optimizing-a-single-node-es-instance-for-throughput/307808/8 "2022-07-28T09:42:48Z")

</div>

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