On-the-fly throttle of CPU consumption of a process

sunhux G sunhux at gmail.com
Wed Apr 7 06:47:01 UTC 2010


Thanks Yong Huang.

'taskset' will fulfill my needs well too.

Cameron was trying to fulfill what I wanted :

a)stopping those annoying alerts

b)if there's constantly other processes that takes up CPU, then renice will
   probably deprive this 'reniced' processes a lot of the CPU resource.  I
   want to be able to control it manually using his script (or for Linux,
   someone else in the Net has cpulimit.c codes that also fulfill what I
need)

c)there's concern that if a novice were to do 'renice' of a "shared" server
   process, such as a Webserver or Oracle server and the server process
   turn out to get very little CPU allocation due to other processes need
   the CPU often, then I would rather to be able to control it manually
   (ie using stutter or cpulimit) than let the system decides it for me (ie
    using renice)

just get to know taskset which will meet my needs for a, b & to an extent
c as well.

However, I'm also looking for similar solution for HP-UX and Cameron's
method could port easily to HP-UX.

Anyone know what's the equivalent for taskset in HP-UX?  Sorry that this
is a Redhat & not a HP-UX list.


To mitigate the situation where a process needs to talk to another
periodically, I thought of using Cameron's solution with very short
intervals (0.1 to 0.2 secs) on HP-UX.  For Linux, taskset is good


On Wed, Apr 7, 2010 at 1:55 AM, Yong Huang <yong321 at yahoo.com> wrote:

> Hi sunhux and Cameron,
>
> Sending SIGSTOP and SIGCONT signals to the process should work but be
> careful with process-to-process coordination. For example, the software
> could be  written in a way that one process periodically talks to another,
> and if it can't, it aborts the application to avoid data corruption.
>
> BTW, when there's no other process using CPU, why do you not allow this
> renice'd process to use all? You just don't want to be bothered by the
> alert?
>
> You can use taskset to set a process's CPU affinity.
>
> Yong Huang
>
>
>
>



More information about the redhat-list mailing list