When a running process hogs a CPU, I would like to be able to reduce its % CPU consumption,
say to 50%. Is there a command to do this or this is possible in CentOS, HP-UX & Redhat ?
I know if we started a process / script using "nice", say "nice ./scriptname", it will give the
process a lower priority (I think) so that other processes will get a higher priority to use
the CPU but still a nice process will chew 100% of the CPU when no other processes
are using it, correct me if I'm wrong.
My purpose is so that we don't get a lot of alerts - having said this, it makes sense to
tune the monitoring tool's threshold but there's a lot of bureacracy involved in tuning &
it takes a while to get the tuning approved. I'm looking for quick interim fix to reduce
the overwhelming alerts though this does not address the root cause.
The best idea I can find so far to achieve this is the link below to put it in the code as
follows but this is still short of a quick fix :
One thought : can a running app (eg Websphere, Weblogic, Tomcat, Oracle instances)
be set such that it uses only a specific processor in a multiple processor environment :
the averaged value of all the processors can then show a lower average CPU utilization.
The other lower CPU hungry process can be shifted to one processor and those
savage ones restricted to 1 or 2 processors : I'm not sure if this manual reshuffling
is more efficient that letting the system manages it on its own but just soliciting views.
In some cases, I can't kill or restart resource hungry processes, just looking for ways
to mitigate the situation
Can I say if "uptime" does not show the average load of above 0 (or 1?) then the
constant CPU hogging is not to be worried : what the "top" utility reports for high CPU
utilization is more of a CPU usage at that instant ?