# Reduce Swapping for ES Nodes

**URL:** <https://discuss.elastic.co/t/reduce-swapping-for-es-nodes/111441>\
**Category:** Elasticsearch\
**Created:** [December 12, 2017, 9:31pm UTC](https://discuss.elastic.co/t/reduce-swapping-for-es-nodes/111441 "2017-12-12T21:31:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![corona](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@corona](https://discuss.elastic.co/u/corona)\
**Post date:** [December 12, 2017, 9:31pm UTC](https://discuss.elastic.co/t/reduce-swapping-for-es-nodes/111441/1 "2017-12-12T21:31:34Z")

</div>

Hi,

I'm running version 2.4.1. I have confirmed the bootstrap.mlockall setting is true for the nodes in my cluster. I've been monitoring swap space usage on two servers (which run the ES nodes). I've found that the swap space usage for several nodes seems to continue to grow. For one of the nodes, the swap space grew to around 1.6GB over the span two months time. For another node, it grew to about 734MB over the same time period.

I found this posting which I thought was helpful:

> <https://github.com/elastic/elasticsearch/issues/17605>

It seems to indicate mlockall isn't the most an effective way to prevent swapping. Would you agree with that statement? Also, can you provide recommendations for what to try next in terms limiting swapping? I'm thinking the next step is set the vm.swappiness setting to a lower value?

Overall the two servers are approaching the total defined swap space. I can restart nodes, but would like to avoid doing that if I can. Any thoughts are appreciated.

---

<div class="post-metadata">

**Author:** ![mujtabahussain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mujtabahussain/32/17514_2.png) [@mujtabahussain](https://discuss.elastic.co/u/mujtabahussain)\
**Post date:** [December 12, 2017, 11:41pm UTC](https://discuss.elastic.co/t/reduce-swapping-for-es-nodes/111441/2 "2017-12-12T23:41:40Z")

</div>

I recommend reading [this document](https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html#_swapping_is_the_death_of_performance) unless you already have 🙂

---

<div class="post-metadata">

**Author:** ![corona](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@corona](https://discuss.elastic.co/u/corona)\
**Post date:** [December 13, 2017, 2:25pm UTC](https://discuss.elastic.co/t/reduce-swapping-for-es-nodes/111441/3 "2017-12-13T14:25:49Z")

</div>

Thanks for your response! Yep, I did come across this document as well.

---

<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 10, 2018, 2:25pm UTC](https://discuss.elastic.co/t/reduce-swapping-for-es-nodes/111441/4 "2018-01-10T14:25:59Z")

</div>

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