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.

Is is possible to limit the usage of resources (cpu, memory etc) based on aggregated and not per process resource usage?

For example I would like to say all processes combined cannot exceed 90% memory/cpu usage, but don't include ssh (so that I can log in to fix the problem).

This would prevent both resource starvation and under-utilisation.

Am I missing something obvious? Is the question wrong to begin with?!

Thanks in advance

share|improve this question
add comment

1 Answer

Kernel 2.6 includes a feature called cpuset. With it you can partition services to separate pools, each having their own restrictions such as "processes belonging to this cpuset can only use cores 1-4".

In addition to CPU you can also control memory usage with cpuset -- take a look at its man page.

So, just create an own cpuset partition to your web server processes, database processes and whatnot and another for ssh and other system processes you'd like to keep available all the time.

share|improve this answer
add comment

Your Answer

 
discard

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