Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have been testing the ionice command for a while and the idle (3) mode seems to be ignored in most cases.

My test is to run both command at the same time:

  • du <big folder>
  • ionice -c 3 du <another big folder>

If I check both process in iotop I see no difference in the percentage of io utilization for each process.

To provide more information about the CFQ scheduler I'm using a 3.5.0 linux kernel.

I started doing this test because I'm experimenting a system lag each time a daily cron job updatedb.mlocate is executed in my Ubuntu 12.10 machine.

If you check the /etc/cron.daily/mlocate file you realize that the command is executed like:

/usr/bin/ionice -c3 /usr/bin/updatedb.mlocate

Also, the funny thing is that whenever my system for some reason starts using swap memory, the updatedb.mlocate io process is been scheduled faster than kswapd0 process, and then my system gets stuck.

Some suggestion?

References:

share|improve this question

2 Answers 2

ionice only works if you're using the CFQ kernel scheduler. Distributions seem to default to deadline scheduler.

Look at /sys/block/xvdh/queue/scheduler to see which you have enabled. It is the one in square brackets.

share|improve this answer

I think that is the expected behaviour - at least if both processes have an I/O share near 100%. There should be a small difference but 100% is the limit and if you are already at 96% then getting just half of the I/O results in 98%. No big deal.

A serious difference should be discernible in the absolute transfer values. This difference may depend on the CPU priority, too.

I/O prio idle doesn't mean that the system is not affected at all. If non-idle processes do not consume the whole available I/O then the prio idle process gets I/O bandwidth, too. Thus it may happen very often that a non-idle prio application demands I/O and does get the next slot but because there is an IOP just being executed for the idle prio process the lantency increases. The less I/O a process causes the bigger should be the idle prio process's impact on it. Thus it might help to reduce the CPU priority of the cron process (maybe even making it SCHED_IDLE).

I have no idea about the swap problem though.

share|improve this answer
    
But it's weird that if a process has idle/low io setup, it can interfere in the competition for the disc. I'm not saying that the idle processes don't reach never disc, but much less than the high priority. –  Ferran Basora Mar 18 '13 at 14:40

Your Answer

 
discard

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.