Document that tmpfs storage is charged to container memory usage #47967
Labels
area/docs
kind/enhancement
Enhancements are not bugs or new features but can improve usability or performance.
Description
I am writing because I am wondering if I am wrongly interpretating the docker online documentation. Thus I’d like to understand
Here is a docker run call
Reproduce
or alternatively
followed by
Inside the container, I can see the 25000m allocated to the /app mount point - this is the partial output of the df -h.
This is consistent with the documentation tmpfs mounts | Docker Docs
but In both cases (i.e. "-mount type=tmpfs,destination=/app,tmpfs-size=25000m" or "-v /mnt/tmpfs:/app") I am not able to write more than --memory limit
I tested this with sequential dd calls e.g
Expected behavior
Thus, I am not able to write more than 5000m on /app (I tested this with dd by writing more files). Apparently, this seems to be not consistent with documentation. Indeed neither the previous link nor Runtime options with Memory, CPUs, and GPUs | Docker Docs report any interaction among --memory --memory-swap and --mount type=tmpfs
Apparently, it seems that docker is not able to distinguish between the ram allocated (5000m ) and the tmpfs (independently on how the tempfs has been created.
And when the tempfs reaches the --memory --memory-swap limit, the container is killed (or I dd is killed)
But is this the expected behaviour?
If the answer is yes:
if the answer is not (i.e. the behaviour described is not expected), then the expectation is that the usage of the tmpfs should be independent of the --memory=5000m --memory-swap=5000m
docker version
docker info
Additional Info
I have checked other opened issues but, apparently, I was not able to find a similar topic
I reported the same question here https://forums.docker.com/t/docker-mount-type-tmpfs-memory-usage/141924
Please let me know if you need further info
Kind regards
Antonio
The text was updated successfully, but these errors were encountered: