Can you stack nice and ionice?

Richard Shaw hobbes1069 at gmail.com
Thu May 3 21:08:59 UTC 2012


I have a CPU and IO intensive task I'd like to tame a bit but I'm not
sure if this can be done in a one-liner. Since both nice and ionice
are designed to run only a single command I'm not sure if the
following would work:

ionice -c3 nice -n19 <process>

It looks like to me that ionice is going to run nice who's going to
run the task.

Another option is to ionice bash but by default the process is not
started in a shell so I would have to script it:

#!/bin/bash
ionice -c3 $$
nice -n19 <process>
--- end ---

I tried examining the first example using pstree but I don't think the
processes "stacked".

Thanks,
Richard


More information about the users mailing list