Open Ambrevar opened 6 years ago
I recently added nice -n 20 to my personal little rsync backup script. Some default niceness for each started copy job I think is the same as starting cpd with some niceness, right? So I guess that's not what you would like. But my backup script is now less noticeable and I think for cpd would it be a good thing to have a build in niceness too.
Make exact specifications how what has to be implemented. I have put it on the readme todo list.
I did not mean to start the daemon but the jobs with ionice/nice.
For example:
-n 17
start the job with ionice -n 17 cp ...
.Also note that ionice
has scheduling classes such as Idle
. Can be very useful.
Note that once a command was started with ionice
, its effect cannot be reverted.
Last, I think ionice
is Linux-specific. nice
is available on most other Unices.
I did not mean to start the daemon but the jobs with ionice/nice.
I know, that's why I ask
Some default niceness for each started copy job I think is the same as starting cpd with some niceness, right?
I can't find it in my nice man page but IIRC will the niceness inherited to sub processes
With no option, no need to do anything special.
Sure. That's why I note/ask
But my backup script is now less noticeable and I think for cpd would it be a good thing to have a build in niceness too.
Also note that ionice has scheduling classes such as Idle. Can be very useful.
Please be more specific what do you want
Note that once a command was started with ionice, its effect cannot be reverted.
Why I have to know this while coding your wishes?
Last, I think ionice is Linux-specific. nice is available on most other Unices.
And? What do you try to say? For compatibly reasons forget ionice or do you request some extra hacks to fit the system where it is running?
After a short search about all this I found this as my first hit. Looks surprisingly extensive the options.
Now I have got the idea to add an option like -extra/-prefix (please help to find a meaning full and short name/letter) where someone can give what ever he want to some job, e.g.
cpc -extra'ionice -c2 -n7 nice -n19' foo bar
There is then no cpd command to modify a running job in this topic. But show w/wi displays the PID of each running job, so you can do your changes by the usual way.
It would be nice if each job's niceness / ioniceness could be tweaked independently. I think that would be easy enough to add.
Not sure
nice
is needed at all though, I'd say onlyionice
is relevant here.