# How to eliminate swapping of logstash container

**URL:** https://discuss.elastic.co/t/how-to-eliminate-swapping-of-logstash-container/151873
**Category:** Logstash
**Created:** [October 10, 2018, 3:06pm UTC](https://discuss.elastic.co/t/how-to-eliminate-swapping-of-logstash-container/151873 "2018-10-10T15:06:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![netvmdb](https://avatars.discourse-cdn.com/v4/letter/n/b9e5f3/32.png) [@netvmdb](https://discuss.elastic.co/u/netvmdb)
#### Post date: [October 10, 2018, 3:06pm UTC](https://discuss.elastic.co/t/how-to-eliminate-swapping-of-logstash-container/151873/1 "2018-10-10T15:06:43Z")

</div>

elasticsearch / logstash / kibana oss 6.2.4 running as docker containers in one physical host.  
Already set vm.swappiness=1 on the host. But swappiness still happening.

I tried following setting for elasticsearch nodes, but swapping still happening on elasticsearch nodes. Not sure what setting I can try on logstash?

```
environment:
  - bootstrap.memory_lock=true

ulimits:
  memlock:
    soft: -1
    hard: -1

```

Thanks.

---

<div class="post-metadata">

### Author: ![netvmdb](https://avatars.discourse-cdn.com/v4/letter/n/b9e5f3/32.png) [@netvmdb](https://discuss.elastic.co/u/netvmdb)
#### Post date: [October 12, 2018, 6:22pm UTC](https://discuss.elastic.co/t/how-to-eliminate-swapping-of-logstash-container/151873/2 "2018-10-12T18:22:36Z")

</div>

If I restart all containers, the host will reclaim all the free swap space initially. But host gradually lost its swap space.  
If I increase JVM heap size to 8GB, it slows down the rate of disappearing swap space.  
I am using daily index and one log file has 25GB data/day. What is the idea heap size for JVM?

Thanks,

---

<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: [November 10, 2018, 10:06am UTC](https://discuss.elastic.co/t/how-to-eliminate-swapping-of-logstash-container/151873/5 "2018-11-10T10:06:31Z")

</div>

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