# How should I configure memory swapping?

**URL:** <https://discuss.elastic.co/t/how-should-i-configure-memory-swapping/347010>\
**Category:** Elasticsearch\
**Created:** [November 13, 2023, 12:24pm UTC](https://discuss.elastic.co/t/how-should-i-configure-memory-swapping/347010 "2023-11-13T12:24:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticsearchman](https://avatars.discourse-cdn.com/v4/letter/e/eada6e/32.png) [@elasticsearchman](https://discuss.elastic.co/u/elasticsearchman)\
**Post date:** [November 13, 2023, 12:24pm UTC](https://discuss.elastic.co/t/how-should-i-configure-memory-swapping/347010/1 "2023-11-13T12:24:47Z")

</div>

Hello,

I want to build Elasticsearch and Kibana using Podman on RHEL 8.5. It is my understanding that disabling memory swapping is a best practice in Elasticsearch.

I am planning to implement the following settings based on the official documentation: [RHEL 8 using Podman | Elastic Cloud Enterprise Reference [3.5] | Elastic](https://www.elastic.co/guide/en/cloud-enterprise/3.5/ece-rhel8-podman-installation-onprem.html)

I intend to execute the following configurations:

- `sudo /sbin/grubby --update-kernel=ALL --args='cgroup_enable=memory cgroup.memory=nokmem swapaccount=1'`
- `vm.swappiness=1`

However, it seems these settings are not for disabling memory swapping but rather to minimize it. According to the documentation, simply editing the /etc/fstab file and commenting out any lines that contain the word "swap" is suggested to disable it permanently. Is this approach acceptable? [Disable swapping | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html)

---

<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:** [December 11, 2023, 12:24pm UTC](https://discuss.elastic.co/t/how-should-i-configure-memory-swapping/347010/2 "2023-12-11T12:24:48Z")

</div>

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