ionice support (initially for rdiff-backup)
rdiff-backup can cause a lot of IO when scanning though folders. Running with ionice would be useful on top of the nice functionality (I see at least one other has requested it via debian bugs also). Here's a start - if happy I can continue and add it for other handlers that could benefit.
This patch also moves ionice commandline to $execstr so the debug output can show the complete commandline including ionice/nice config - which I think is useful for debugging. it is also only used now if ionice level is set, rather than always with a default of 0
ionice config is done with a "ionice_params" variable so users can manually set the commandline. I was testing with "-c3" for my set up.
#5 Updated by ulrich almost 2 years ago
After I read about the preparations for a new release on the mailing list I decided to review and test some of the proposed patches and report back. First thanks to exobuzz for the proposed patch.
The patch is short an works against the latest git master. I tested it without the ionice_params set and a dozen of well formed and erroneous settings for ionice and all resulted in the expected behavior.
Further more the
su -c was moved outside the range of
nice. It is needed for ionice but now it is also guaranteed, that a negative nice level is independent of the privileges of the executing script part. For example the oneliner
nice -n -5 su -c echo fails as normal user while
su -c "nice -n -5 echo" works fine.
At the moment backupninja is always running with root privileges, so it doesn't matter now, but maybe some time in the future. For backups by users or something like that.
#6 Updated by intrigeri almost 2 years ago
- Status changed from Confirmed to In Progress
- % Done changed from 10 to 20
- QA Check changed from Ready for QA to Dev Needed
Thanks! Next step is to update
examples/example.rdiff so that one can discover this option without having to read the source code (ideally,
handlers/rdiff.helper.in should be updated too but I won't block on this).
#7 Updated by ulrich almost 2 years ago
Here is a patch for the examples/example.rdiff.
Feel free to enhance the explanation of the options.
I'm going to look into handlers/rdiff.helper.in but need a tester after I finished the patch.
#8 Updated by ulrich almost 2 years ago
Here is the promised patch for handlers/rdiff.helper.in.
I added two options for nice and ionice_params to the advanced menu of the configuration wizzard of the rdiff handler. The created config file will contain the two options nice and ionice_params and a short description.
I tested in on my local machine with debian. The patch doesn't add much code to the script and there shouldn't be any problems, but can somebody test it please?
#10 Updated by ulrich almost 2 years ago
My patches can also be found at my git repository (https://github.com/UlrichViefhaus/backupninja) in the branch Feature6796: https://github.com/UlrichViefhaus/backupninja/tree/Feature6796
I hope it helps to integrate the patches in the next release. Can someone test it, please?