Niceness: Reduce the priority of the local and/or remote rsync process by command line option similar to nice or ionice#933
Conversation
|
How is it different from prepending |
Prepending nice and/or ionice to the remote depends on that these utilities have actually been installed by the user. We do not know, if this is the case on the remote site and if not, the remote command will fail to execute rsync. With prepending nice/ionice there would be also additional processes to be launched, maybe that could be an issue. |
The administrator of the restricted environment can be contacted to provide the means to resolve the issue (if they see it as an issue at all, because they may not be concerned about high CPU/disk usage). |
|
Thank you for the workaround with --rsync-path. It is a good workaround for the meantime and works fine with linux. |
|
thanks for making an enhancement to rsync. I'm a little bit surprised, that we have that many new options for adjusting niceness, but without the capability of the original tools, i.e. if you add this complexity, i think adjusting the level to the desired values should also be possible. anyhow, i'm not sure if that belongs into rsync, i don't have yet an opinion on that. |
|
I got the idea, that this might be useful, when I was working on something and felt then the computer's performance went poor after a BackupPC job started. I thought about implementing levels already, but found the following issues: For Ionice: We have four classes: 0 and 2 both are effectively best-effort, 1 is real time and 3 is idle. In addition to that, there are seven priorities that can be set in addition to the class and are only effective for class 1 and 2. For class 0 the priority is taken from the nice value. When we want to bring heavy io load of rsync into the background, usually 3 (idle) is the best option, best effort with other priorities brings only a small, negligible advantage. Running rsync in real-time is possible and needs root, but does it actually make sense? But it would be easy for me to change the functionality of the renice switch to contain a renice level instead of just a boolean switch and add another option which takes an argument for the nice priority that is then also used to pass the priority to the remote rsync. The existing options will remain unchanged and renice to 19 when turning nice on. If a level was already set there, it shouldn't be overwritten by turning it on. I think it is a good idea for me to develop this on a new branch derived from this, so that the current state can already be reviewed and merged and thus already made available while I am working on the improvements on another branch. I will add two voting comments (vote by adding a like) for the mentioned improvements. |
|
VOTE: Like to vote for specifying nice levels in rsync |
|
VOTE: Like to vote for specifying IOnice levels in rsync |
|
|
Problem:
rsync with plenty of files and data (e. g. for backup purposes) puts load on the client and server machine and people working on these machines might experience a noticeable performance degradation when hardware comes to it's limits. As a workaround the user may renice or ionice the rsync processes to mitigate the issue, but this requires ownership of the running rsync-processes or root access and only works temporarily on the already running process.
Thus in several cases it would be desireable that rsync (e. g. when automatically started by a script or cron job, etc.) gives way for other activities, reducing the impact on those working on the machines.
Solution:
Added command line options to lower the priority of the rsync process like with renice (lower CPU priority) or ionice (lower IO priority), so that other activities on the machine are not affected by the running rsync job so much.
The option names are derived from the well known unix tools nice/renice and ionice that can be used to alter priorities of running processes.
With --nice-local or --ionice-local, if there is no support on the local machine OS for reducing priority, despite of a current rsync version, the option is silently ignored.
With --nice-remote or --ionice-remote, if there is no support on the remote machine OS for reducing priority, despite of a current rsync version, the option is silently ignored. If in this case the rsync version on the remote machine does not yet support the new command line options, rsync reports an error.