tmpfs wrong size in LXC container

mateusz1234

Member
Apr 22, 2021
13
0
6
32
Hi!
I just found an issue with tmpfs in my LXC containers. Example, I have a container with have assigned 4GB RAM but tmpfs shows 32GB with is half of the host memory:
Code:
df -h
Filesystem             Size  Used Avail Use% Mounted on
udev                    32G     0   32G   0% /dev/tty
tmpfs                   32G     0   32G   0% /dev/shm
tmpfs                   13G   48K   13G   1% /run
tmpfs                   32G     0   32G   0% /tmp
This caused me a big issue where mysql when repairing a table was coping it to tmp because "he, tmp is 32GB so no problem" but then the process got killed when the copied data got over ~4GB.
Is they is some way to prevent such issue? Is tmp mounted by the host in the lxc or guest?