# Disable memory swap on Unix RPM

**URL:** https://discuss.elastic.co/t/disable-memory-swap-on-unix-rpm/172320
**Category:** Elasticsearch
**Created:** [March 14, 2019, 11:03am UTC](https://discuss.elastic.co/t/disable-memory-swap-on-unix-rpm/172320 "2019-03-14T11:03:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fedwe](https://avatars.discourse-cdn.com/v4/letter/f/a88e4f/32.png) [@fedwe](https://discuss.elastic.co/u/fedwe)
#### Post date: [March 14, 2019, 11:03am UTC](https://discuss.elastic.co/t/disable-memory-swap-on-unix-rpm/172320/1 "2019-03-14T11:03:14Z")

</div>

Hello i want to diasble memory swapping on elastic search but i don't know how to make it work  
i have systemd and i couldn't find this file /etc/systemd/system/elasticsearch.service.d/override.conf  
and i tried using sudo systemctl edit elasticsearch it gave me an empty editor and i didn't know what to write. Can you please help me fix this issue

---

<div class="post-metadata">

### Author: ![ariemenschneider](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ariemenschneider/32/33564_2.png) [@ariemenschneider](https://discuss.elastic.co/u/ariemenschneider)
#### Post date: [March 14, 2019, 12:14pm UTC](https://discuss.elastic.co/t/disable-memory-swap-on-unix-rpm/172320/2 "2019-03-14T12:14:22Z")

</div>

Hi,

in order to disable swapping of Elasticsearch memory, the file You mentioned should contain:

`[Service]`  
`LimitMEMLOCK=infinity`

This is described in the [ElasticSearch Reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-system-settings.html#systemd), but I also did not find it right away.

We also set there the NOFILE limit for Elasticsearch:

`LimitNOFILE=65535`

Hope, that helps!  
Alex

---

<div class="post-metadata">

### Author: ![fedwe](https://avatars.discourse-cdn.com/v4/letter/f/a88e4f/32.png) [@fedwe](https://discuss.elastic.co/u/fedwe)
#### Post date: [March 14, 2019, 12:34pm UTC](https://discuss.elastic.co/t/disable-memory-swap-on-unix-rpm/172320/3 "2019-03-14T12:34:14Z")

</div>

thank you for the help turns out i had to manually create it

---

<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: [April 11, 2019, 12:34pm UTC](https://discuss.elastic.co/t/disable-memory-swap-on-unix-rpm/172320/4 "2019-04-11T12:34:15Z")

</div>

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