Lxc Memory limit

yena

Renowned Member
Nov 18, 2011
373
4
83
Hello,
can i modify the lxc behavior when the container reach the ram limit ?
Now on some containers i see that mysql is often killed:

Host syslog:
------------------------------------------------------------
May 8 08:07:30 nodo3 kernel: [1504328.952937] Task in /lxc/343/ns killed as a result of limit of /lxc/343
May 8 08:07:30 nodo3 kernel: [1504328.952942] memory: usage 2004860kB, limit 3145728kB, failcnt 0
May 8 08:07:30 nodo3 kernel: [1504328.952943] memory+swap: usage 3145728kB, limit 3145728kB, failcnt 61576889
May 8 08:07:30 nodo3 kernel: [1504328.952944] kmem: usage 0kB, limit 9007199254740988kB, failcnt 0
---------------------------------------------------------------

I have noticed it migrating some Openvz container on a new Lxc ..

Thanks!
 
I do not understand how exactly you'd like to modify it. What should kernel do when VM reached its limit of ram+swap usage, and yet some process wants to allocate more memory?
 
I do not understand how exactly you'd like to modify it. What should kernel do when VM reached its limit of ram+swap usage, and yet some process wants to allocate more memory?

He expect that when the memory is full, that any request for new memory allocation to be denied. In any case he did not want to see a process to be killed. I do not know how it is normal to be in lxc, but I am very sure that is true 100 % for openvz. So, the @yena question is not so dummy.... if someone read it carefully ;)
 
  • Like
Reactions: yena
Exactly, i would like to know if i can i denied memory access without kill the process ..
A workoround should be a monit process on the guest ...
Thanks
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!