PVE9.x Debian13 LXC /tmp

drevilish

Member
Oct 22, 2023
3
1
8
I noticed an issue where I was experiencing a lot of OOM errors within my LXC containers. After updating to Deb13/PVE9.x I found some of my LXC containers at 99% CPU and 99% MEM usage.

Debian 13 has by default, moved /tmp to a tmpfs.

It incorrectly pulls the amount of memory tmpfs has avaliable as the host memory capacity, in my case 64GB, tmpfs defaults to size=50%. Meaning the LXC thinks it can use 50% of avaliable memory for /tmp.
If I set the container memory limit to 1GB, if the /tmp directly tries to store more than 1GB, it's not allowed and the CPU spikes to 99% and memory usage is stuck at 99%.

"You can return to /tmp being a regular directory by running `systemctl mask tmp.mount` as root and rebooting."

https://www.debian.org/releases/tri...-files-directory-tmp-is-now-stored-in-a-tmpfs
https://manpages.debian.org/trixie/manpages/tmpfs.5.en.html

Please let me know if you think I've missed something.
 
  • Like
Reactions: leesteken
Indeed, the /tmp has a limit of about half of the host memory (which is 256 times more than the memory setting for this particular CT). Also, systemd-networkd-wait-online was enabled and not working, based on the default Debian 13 CT template.