# Regarding Elasticsearch and Docker

**URL:** <https://discuss.elastic.co/t/regarding-elasticsearch-and-docker/145579>\
**Category:** Elasticsearch\
**Created:** [August 22, 2018, 3:15pm UTC](https://discuss.elastic.co/t/regarding-elasticsearch-and-docker/145579 "2018-08-22T15:15:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)\
**Post date:** [August 22, 2018, 3:15pm UTC](https://discuss.elastic.co/t/regarding-elasticsearch-and-docker/145579/1 "2018-08-22T15:15:55Z")

</div>

Hi,  
I have a question regarding memory sizing for an elasticsearch docker container. If a node requires 8GB of HEAP then it is normal to provision 16GB of RAM for filesystem caching. When running elasticsearch in docker and mounting indexing volumes from the host is the filesystem cache maintained by the container or the host? The answer will dictate how much memory I should allocate to the container...

Regards,  
David

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [August 24, 2018, 11:08am UTC](https://discuss.elastic.co/t/regarding-elasticsearch-and-docker/145579/2 "2018-08-24T11:08:08Z")

</div>

Hi,

if you set a memory limit in the Docker container, this also limits its access to the hosts file system cache (see also a [related comment on Github](https://github.com/elastic/elasticsearch-docker/issues/122#issue-260826191) for details). So we'd advise against setting a memory limit in the container.

Daniel

---

<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:** [August 24, 2018, 12:05pm UTC](https://discuss.elastic.co/t/regarding-elasticsearch-and-docker/145579/3 "2018-08-24T12:05:37Z")

</div>

The container does not have its own kernel, it is shared with the host. Thus, the cache that is used here is the cache of the host (and it's the only filesystem cache in play).

---

<div class="post-metadata">

**Author:** ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)\
**Post date:** [August 27, 2018, 8:11am UTC](https://discuss.elastic.co/t/regarding-elasticsearch-and-docker/145579/4 "2018-08-27T08:11:12Z")

</div>

Ok, I'm not setting any memory limits so that's fine. What happens if the index volume is mounted directly in the container rather than on the host itself?

---

<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:** [September 24, 2018, 8:11am UTC](https://discuss.elastic.co/t/regarding-elasticsearch-and-docker/145579/5 "2018-09-24T08:11:13Z")

</div>

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

---

<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:** [September 27, 2018, 2:25am UTC](https://discuss.elastic.co/t/regarding-elasticsearch-and-docker/145579/6 "2018-09-27T02:25:45Z")

</div>

That is not an architecture that we recommend because it entails losing the volume when the container is destroyed (as would be the case when upgrading to a new version). For non-ephemeral data, the volume should be bind mounted to the container.
