Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My two ubuntu multi-core processor servers (tomcat and mysql) are usually down. Therefore, I need a way to limit the cpu to 90% to ensure my servers is responsive (then, i can remote via ssh). I found a package in ubuntu, cpulimit. However, it seems not able to set limit for multi-core processors. Any suggestions?

share|improve this question
up vote 2 down vote accepted

Somewhere along the development of Linux 2.6.x it got a fancy new feature, cpuset. It allows process grouping. With cpuset it's possible to limit not only CPU usage, but also memory usage.

Here is an excellent wiki describing the topic with numerous examples. Should you have any further questions please don't hesitate to ask.

Please also remember that many times if some server process manages to bring your server down, it's not due CPU usage. Most of the time some process eats all the available RAM (and swap), causing a swap storm, which causes your server spending all its time swapping and not getting any real work done. Bear that in mind while configuring your cpuset. :)

share|improve this answer

Your Answer


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.