I need to run some long and heavy commands but at the same time I'd like to keep my desktop system responsive. Examples: btrfs deduplication, btrfs balance, etc. I don't mind if such commands take longer to finish if I give them a lower priority, but my system should be responsive at all times. Using nice -n 19 and ionice -c 3 should solve my problem, but I'm not sure which command should come first for maximum benefit.
Option A:
# nice -n 19 ionice -c 3 btrfs balance start --full-balance /
Option B:
# ionice -c 3 nice -n 19 btrfs balance start --full-balance /
Is there some subtle difference between options A and B? Are they equivalent perhaps?
ionicewere very computational, ornicedid lots of I/O. Neither is true. – Barmar Sep 5 '17 at 17:21