Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a KSH crawler script that crawls filesystems on my network, and i would like to limit it to 25% cpu usage, so it does not impact running systems. I am currently using nice but when i run SED, FIND, and some other commands CPU is going above 60% and I dont want that to happen.

I have heard of ulimit, but that is for BASH. Is there a KSH variant of this?

share|improve this question
CPU above 60% probably means the CPU would be 60% idle if the script were not running. Is there actual evidence of other processes being starved of CPU? – RedGrittyBrick Sep 25 '12 at 16:08
@RedGrittyBrick No, but we cannot take any chance that there will be...nor can we take these systems offline, without failing over to DR. Which is not an option. – nitrobass24 Sep 29 '12 at 1:10

If you have multiple cores, use CPU-pinning AKA CPU-affinity. See taskset

The Linux scheduler will honor the given CPU affinity and the process will not run on any other CPUs.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .