rsync 删除太慢 - 有什么想法吗?

发布于 2024-10-21 08:58:17 字数 540 浏览 3 评论 0原文

我有多个实例在 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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

过去的过去 2024-10-28 08:58:17

Lee,

发生这种情况的原因有多种:

  • 磁盘问题。我怀疑是否是这种情况,因为你在EC2
  • 硬盘参数配置错误。非常罕见,但仍有可能
  • 一般高 I/O 活动会减慢速度。如果服务器承受大量工作负载,这可能会影响每个操作,包括文件删除
  • 其他应用程序正在使用这些文件,因此需要更长的时间来删除

第二项在我看来是您应该努力的方向。这要么是文件系统的错误选择,要么有人试图调整 HD 参数,结果把事情弄乱了。

祝你好运!
多坦

Lee,

This can happen due to several reasons:

  • A disk problem. I doubt if this is the case, since you're in the EC2
  • Hard disk parameters configured wrongly. Very rare, but still a possibility
  • General high I/O activity that slows things down. If the server is under a lot of work load, this might effect every action, including file deletion
  • Other applications are using the files, thus taking it longer to delete

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文