Server Fault is a question and answer site for system and network administrators. 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 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?

share|improve this question

migrated from Nov 28 '11 at 11:05

This question came from our site for professional and enthusiast programmers.

for future googling, try looking up "affinity". – Sirex Nov 28 '11 at 11:11
up vote 3 down vote accepted

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

$ man taskset

share|improve this answer
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 '11 at 17:57
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. – duskwuff Sep 3 '11 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 '11 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 '11 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 '11 at 11:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.