Linux – How to be notified when the limit of a cgroup is hit

alertingcgrouplinuxmonitoring

I want to use cgroups to limit resources in linux

http://en.wikipedia.org/wiki/Cgroups

How can I be notified when a limit if hit. For example if I limit a process to 2 gigs or ram how will I know when that is reached if I am not actively monitoring it?

Best Answer

cgroups support a Notification API as described here in section 2.4: http://www.kernel.org/doc/Documentation/cgroups/cgroups.txt