我在 Linux 服务器中有大量数据(300GB)。现在,我想使用rsync
over ssh传输到另一台 Linux 服务器。当我传输数据时,它会在服务器中产生巨大的负载。我可以知道在通过 ssh 传输大量数据时如何避免服务器中的负载吗?
使用较弱的 ssh 密码(例如 arcfour),如下所示:
rsync -av source --rsh="ssh -c arcfour" foo@bar:/destination
可能还有更弱的密码,但 arcfour 是我的首选,因为它不是安全性和速度之间的最佳折衷(在我的情况下,搜索密码基准,周围有很多)。
或者根本不使用 ssh 并在目标服务器上运行 rsync 守护程序。
我找到了通过在 rsync 中包含 ionice 和 nice 命令来避免在远程和本地服务器之间的文件期间服务器负载的解决方案
ionice - get/set program io scheduling class and priority
nice - run a program with modified scheduling priority
#rsync -r -az --rsync-path="ionice -c 3 nice rsync" -e "ssh -p 8363" username@ip-address:/source-file /destination
Run Code Online (Sandbox Code Playgroud)