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

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

1 Answer 1

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

 
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.