[CentOS] Looking for a method to keep at least 5% CPU

Thu Nov 27 04:32:55 UTC 2008
nate <centos at linuxpowered.net>

Ryan J M wrote:
> Hi all,
>    Sometimes, the working threads occupy 100% CPU, and I just cann't
> ssh login with root. my question is: Is there any solution for this
> case?
> I googled and  found some related links, but not helpful.

I'm not aware of any method under linux directly to reserve a set
amount of CPU resources. You can use /etc/security/limits.conf to
restrict certain amounts of resources but there is nothing there
even that impacts CPU usage on a percentage basis, and of course
nothing that will reserve CPU.

If you can't login with root it sounds like the load on your system
is likely very high, so I'd reduce the amount of working threads.
There's a big difference between cpu usage being at 100% and a
low number of things that are contributing to that 100% usage
number, and having cpu be at 100% and many things contributing
to that number. The latter will definitely have far more serious
performance impact than the former in my experience.

I can recall on countless occasions over the years being able to
login to a system that is running at 100% cpu usage and not
really have any noticeable impact on being able to login or
interact with the system.

nate