There is not enough space available in tmpfs docker container
Asked Answered
F

2

5

I'm running a docker container that seems to have insufficient memory and I'm not sure how to solve this problem.

I'm essentially running a program on this docker container that downloads an image into tmpfs, performs some operations, deletes the the image and returns a result. However, it seems like I'm running into images that are too large to store in my current docker tmpfs. Below is the output of the linux df command while inside the container:

Filesystem      Size  Used Avail Use% Mounted on
overlay          63G   11G   50G  18% /
tmpfs            64M     0   64M   0% /dev
tmpfs           6.9G     0  6.9G   0% /sys/fs/cgroup
/dev/sda1        63G   11G   50G  18% /etc/hosts
shm              64M  4.0K   64M   1% /dev/shm
tmpfs           6.9G     0  6.9G   0% /sys/firmware

I've tried expanding docker's memory (hence the huge values on two of the tmpfs's) but I'm still running into this problem.

I guess I have a couple of questions:

1) what is the difference between the 3 separate tmpfs filesystems? Why do they exist?

2) Presumably I need to expand the first tmpfs size (the small one) -- how would I go about doing that?

Finally, some relevant system information:

OS -- OSX

Docker version -- Docker version 17.09.0-ce, build afdb6d4

Let me know if there's other stuff you need to know!

Thanks everyone.

Faitour answered 21/11, 2017 at 0:12 Comment(0)
F
6

Okay, ultimately figured out the answer. My original two questions were kind of off base.

Essentially, my docker instance didn't have enough memory -- the tmpfs files were red herrings. I ended up needing to pass in a --shm-size="4096m" argument to my docker start command (increased memory to 4096 megabytes) in order to allow my function to properly execute. Hope this helps someone down the road!

Also, for google purpose, the exact error I was getting was There is not enough space available on the shmfs/tmpfs file system. relating to Abbyy FineReader

Faitour answered 22/11, 2017 at 0:22 Comment(4)
I had the same problem with Abbyy in Docker. In addition to changing the --shm-size I also had to mount a additional TMPFS filesystem with a bigger size (docs.docker.com/engine/reference/run/…).Isothere
Does anyone know how to do this with docker swarm?Abscise
Is there a similar way for Kubernetes? I am hitting the same issue in Kubernetes.Extraversion
Figured out.. that Abbyy uses /dev/shm. There was a space issue in the /dev/shm and so it was bailing out. Just mounted a disk at /dev/shm inside the Kubernetes container and it all worked just fineExtraversion
E
0

If you are using Kubernetes, then you need sufficient space in /dev/shm. In my case, there wasnt enough space in /dev/shm hence Abbyy would bail out before extracting Meta-images. After giving /dev/shm a volume mount, it worked fine. Hope this helps!

Extraversion answered 14/11, 2019 at 0:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.