0

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

1 Answers1

1

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.

Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81