That’s basically the limits.memory behavior, we set a soft limit of 90% of the amount and a hard limit at 100% of the amount, the OOM will trigger within the container if you use it all.
You can do that at the project level by setting a limits.memory on the project.
When you do that, every instance will need to have a limits.memory set so the total allocated (rather than used) can be computed, preventing you from creating instances once you’ve reached the project limit.
Ah, right, so you want a two tier kinda limit for each instance, allowing to burst with extra risk.
I don’t believe there’s any way to do that at the kernel level on either cgroup1 or cgroup2.