I have a Debian server with software-RAID and a quad-core processor. Once all cores are under full load, the RAID system has a huge IO delay.

The server is running some very CPU-expensive jobs.

Is it possible that I can tie these jobs to specific cores so I can reserve one core for RAID?

  • for future googling, try looking up "affinity".
    – Sirex
    Nov 28, 2011 at 11:11

1 Answer 1


Yes, you can use taskset to do this. I doubt that it will make much difference though.

$ man taskset

  • Thanks for your answer. Why do you think it doesn't make much difference if I reserve one core for everything except these jobs? The jobs don't access the disks, they just hit the cpu very hard.
    – Philip
    Sep 3, 2011 at 17:57
  • 2
    The kernel is already pretty good at figuring out what CPU cores to use for tasks. Second-guessing it with taskset usually leads to worse results.
    – user15323
    Sep 3, 2011 at 18:01
  • @duskwuff: absolutely - that's why I said that I doubt that it will make much difference. I have encountered particular cases where it helps though, so it's worth trying, even if it turns out not to yield any benefit.
    – Paul R
    Sep 4, 2011 at 7:29
  • @Philip: as duskwuff says, Linux already does a pretty good job of managing CPU affinity, but it's easy enough to try using taskset to see if it helps, so I would still try it.
    – Paul R
    Sep 4, 2011 at 7:31
  • I've tied the jobs to the first 3 cores so core number 4 has no load. I am seeing a improvement. The software raid works the way it should and other processes can continue while the first 3 cores are basically locked. Thanks for the help!
    – Philip
    Sep 4, 2011 at 11:19

You must log in to answer this question.

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