How can I set CPU max % usage for a process ?
I am trying to figure out how to set CPU max % usage for an individual process. Ex.: I want process "A" to use a max of 20% from the CPU when it runs. I don't really care right now how much CPU max time in seconds it should run, I am only interested in the CPU max usage in %, when the process runs.
Any suggestions ? - Thanks ! |
I don't know if it's possible to allocate a percentage of cpu cycles to a particular process. You can set the nice value with the renice command. Lower values (negative) get more cpu time; higher values (positive) get less cpu time.
|
Well it is possible, but only if you have the latest -rc kernel, and are prepared to play with non-mainline patchsets.
I have only tested on CPU boundaries, not arbitrary percentages. Might also still be some compatibility issues on NUMA (multi-CPU Opteron motherboards e.g.). Still a work in progress ... |
I'd stick with nice and /or one or more ulimit options if they apply.
|
All times are GMT -5. The time now is 11:41 AM. |