7

I'm running software that overloads disk IO sometimes. I don't need fast response from that software, I need fast response from other applications, so I could set low process priority for that. I want to ask how process priority affects disk IO priority for a process.

I tried a small experiment: I set low priority (in System Monitor under GNOME) for a process and checked IO priority with ionice.

Result:

IO priority = 0 for normal process priority   
IO priority = 4 for low process priority

But will this always work like this? Is IO priority always reduced when I reduce process priority?

10

Under Linux, by default, a process's IO priority is derived from its CPU priority according to the formula

io_priority = (cpu_nice + 20) / 5

IO priority ranges from 0 to 7 with 0 being the highest priority. CPU niceness ranges from -20 to 19 with -20 being the highest priority.

You can use the ionice command to change a process's IO priority. If you want that process to run only when the system isn't otherwise busy, make it run under the “idle” class rather than the default “best-effort” class:

ionice -c 3 -p $PID
ionice -c 3 mycommand --someoption

Even with the lowest priority, a disk-intensive process tends to slow the system down, if nothing else because it pollutes the cache.

See the ionice man page for more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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