rsync 删除太慢 - 有什么想法吗?
我有多个实例在 Amazon EC2 上运行(位于相同的可用区)。
我正在从主服务器运行此命令来更新所有从服务器:
rsync -avz -e '$ssh -o StrictHostKeyChecking=no -i $keyfile' --delete --exclude 'logs/*' $dir_sync ec2-user@$server:$dir_sync
一切正常,除了 - 删除太慢。
每 400-600mb 至少需要 2 分钟文件。
难道不应该直接闪击吗?
有什么线索吗?
更新:
实际上,我登录到从属实例并尝试了rm文件
,并且花费了相同的时间长度,所以我猜测这不是rsync问题,而是一个文件系统。
问题是...我到底如何快速删除文件?
它在大型 EC2 实例上运行,文件只有 400mb...它们真的需要 40-120 秒才能删除吗?
I have several instances running on Amazon EC2 (in the same availability zones).
I'm running this command from the master to update all the slaves:
rsync -avz -e '$ssh -o StrictHostKeyChecking=no -i $keyfile' --delete --exclude 'logs/*' $dir_sync ec2-user@$server:$dir_sync
Everything works fine, except - deletes are so slow.
It's taking at least 2 minutes per 400-600mb file.
Shouldn't it just blitz it?
Any clue?
Update:
Actually, I logged into the slave instance and tried rm file
, and it took the same length of time, so I'm guessing this isn't an rsync issue, but a filesystem one.
The question becomes... how the heck do I quickly zap a file?
It's running on a Large EC2 instance and the files are only 400mb... should they really take 40-120 seconds to delete?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Lee,
发生这种情况的原因有多种:
第二项在我看来是您应该努力的方向。这要么是文件系统的错误选择,要么有人试图调整 HD 参数,结果把事情弄乱了。
祝你好运!
多坦
Lee,
This can happen due to several reasons:
The 2nd item seems to me like a direction in which you should direct your efforts. It's either a bad choice of filesystem, or someone might have tried to tweak the HD parameters, and jumbled things up.
Good luck!
Dotan