Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am the unpopular guy who has brought down our high-memory linux machine twice this past week because some processes I have been running ate up way more ram then expected. One way around this would be to set a per process ulimit so if each process goes over a certain amount of ram usage that process will be killed. Sometimes though I need lots of ram for a single process rather than some ram spread out over a bunch of parallel processes. Rather than relying on me remembering to actively manage my ulimits whenever I run a different kind of job at a different level of parallelism, is there some kind of equivalent to ulimit that looks at the summed ram usage for a user, and then kills all or some of that user's processes rather than sinking the whole system?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

This is almost exactly why Linux control groups (cgroups) were invented. This allows a group of processes (for example, all the processes decending from your initial interactive login) to be treated as a single entity for purposes of resource control -- such as limiting the total amount of memory consumed (or cpu resources, etc).

Unfortunately...

Cgroups are relatively new, and convenient support for them is largely missing in most distributions.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.