Should I set CT Swap to 0 to prevent PVE host crashes during high memory usage?

Oct 14, 2025
44
11
8
Hi everyone, I have a question regarding CT container memory configurations.

Currently, I'm running several LXC containers on a PVE host with various RAM allocations. The largest one is assigned about half of the host's total physical RAM. While the total allocated memory across all containers doesn't exceed the host's capacity—and I've specifically reserved about 5GB of RAM for the PVE host itself—the system should theoretically have enough overhead.

However, this issue has already happened twice now: whenever that high-load CT experiences a spike and its memory usage exceeds 90%, the entire PVE physical host crashes abruptly without warning. I have monitoring alerts set up, so I receive notifications just before it happens, but I have no time to react. Honestly, I haven't been able to pinpoint the exact root cause yet.

My current hypothesis is that even if the CT's RAM seems sufficient, the default Swap setting might be the culprit. When the CT starts utilizing Swap, it’s actually tapping into the PVE host's swap resources. Could this be the primary reason for the host's instability? I’m planning to set the Swap to 0 for all containers. Is this the right approach to take, or am I completely looking in the wrong direction?

Thanks in advance for any advice.
 
Hi,

from my experience you could run into issues as soon as sum of used LXC swap space grows beyond available swap space on that specific PVE node.
Then LXCs could restart or processes inside LXC get killed as soon as they try to use even more swap memory.

But I never had stability issues on PVE node itself.

BR
Marcus
 
Hi,

from my experience you could run into issues as soon as sum of used LXC swap space grows beyond available swap space on that specific PVE node.
Then LXCs could restart or processes inside LXC get killed as soon as they try to use even more swap memory.

But I never had stability issues on PVE node itself.

BR
Marcus

Thanks for your input!

That's a valid point regarding the total LXC swap usage versus the available swap on the host.

I'm still not entirely sure if that's the primary cause in my case, so I'll keep investigating other possibilities as well and see how it goes.

Appreciate the advice!