# The impact of allowing swap

**URL:** <https://discuss.elastic.co/t/the-impact-of-allowing-swap/70316>\
**Category:** Elasticsearch\
**Created:** [December 31, 2016, 9:08am UTC](https://discuss.elastic.co/t/the-impact-of-allowing-swap/70316 "2016-12-31T09:08:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![aabed](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@aabed](https://discuss.elastic.co/u/aabed)\
**Post date:** [December 31, 2016, 9:08am UTC](https://discuss.elastic.co/t/the-impact-of-allowing-swap/70316/1 "2016-12-31T09:08:42Z")

</div>

Hello,

I was wondering what is performance impact of enabling the swap on the server running Elasticsearch  
Given that the swap disk is on SSD

Thanks,

---

<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:** [December 31, 2016, 9:40am UTC](https://discuss.elastic.co/t/the-impact-of-allowing-swap/70316/2 "2016-12-31T09:40:21Z")

</div>

You can't really compare direct RAM with SSD drives.  
I think that elasticsearch 5.0 might refuse to start in that case because of the bootstrap checks.

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [December 31, 2016, 12:05pm UTC](https://discuss.elastic.co/t/the-impact-of-allowing-swap/70316/3 "2016-12-31T12:05:24Z")

</div>

Swap on SSD will be faster than swap on spinning disks, but still materially slower than if you just had sufficient RAM. Beyond this general answer, the only way to truly know is to measure (SSD performance varies a lot depending on the disks you have and their configuration), and the only way to know if the performance is tolerable is to have a performance target in mind and to see if your performance measurements enable hitting that target or not. In the end, I suspect you'll just want more RAM. It's cheap, and Elasticsearch will happily leverage the additional room for the filesystem cache.

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [December 31, 2016, 12:09pm UTC](https://discuss.elastic.co/t/the-impact-of-allowing-swap/70316/4 "2016-12-31T12:09:39Z")

</div>

> [@dadoonet](#):
>
> I think that elasticsearch 5.0 might refuse to start in that case because of the bootstrap checks.

I'm not sure what you're referring to here? There is a [check](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/_memory_lock_check.html) that if you enable `bootstrap.memory_lock` then memory locking must succeed (so no silent failing), but otherwise no checks related to swap.

---

<div class="post-metadata">

**Author:** ![aabed](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@aabed](https://discuss.elastic.co/u/aabed)\
**Post date:** [December 31, 2016, 12:20pm UTC](https://discuss.elastic.co/t/the-impact-of-allowing-swap/70316/5 "2016-12-31T12:20:45Z")

</div>

Thank you for your reply,  
here is the situation

We have a setup where we use a lot of memory and we always adding new machines to the cluster, so someone came up with the idea of adding ssd swap to reduce the cost of spinning more machines

Also what are you referring to as cheap the RAM or the SSD?

---

<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:** [December 31, 2016, 1:02pm UTC](https://discuss.elastic.co/t/the-impact-of-allowing-swap/70316/6 "2016-12-31T13:02:22Z")

</div>

Thanks @jasontedor. I thought we were checking that but was unsure.

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [January 2, 2017, 11:07am UTC](https://discuss.elastic.co/t/the-impact-of-allowing-swap/70316/7 "2017-01-02T11:07:14Z")

</div>

> [@aabed](#):
>
> Also what are you referring to as cheap the RAM or the SSD?

RAM for the performance you get out of it. Slow SSDs are cheap, fast SSDs (anything that can push 2 GB/s) are expensive. But even the fastest SSDs are way, way behind RAM speeds.

---

<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:** [January 30, 2017, 11:07am UTC](https://discuss.elastic.co/t/the-impact-of-allowing-swap/70316/8 "2017-01-30T11:07:30Z")

</div>

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