XCOPY 是通过 Windows 文件系统复制文件夹/文件的最快工具吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23626352/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 11:35:08  来源:igfitidea点击:

Is XCOPY the fastest tool to copy folders/files over Windows file system?

windowscommand-linefilesystemsxcopy

提问by NirMH

I have a maintenance task to copy folders from one server to another. the source folder is big - roughly ~Ks of files / 5-6 tree levels and overall size of ~1GB.

我有一项维护任务,要将文件夹从一台服务器复制到另一台服务器。源文件夹很大 - 大约 ~Ks 的文件/5-6 个树级别和 ~1GB 的整体大小。

I was using Robocopy.exe and XCOPY.exe from windows command line and their performance is fair, and i wonder if there a faster tool to deliver the task.

我从 Windows 命令行使用 Robocopy.exe 和 XCOPY.exe,它们的性能是公平的,我想知道是否有更快的工具来交付任务。

of course the actual performance is highly dependend on network overload, but i believe the test cases use the same environment.

当然实际性能高度依赖于网络过载,但我相信测试用例使用相同的环境。

回答by jdiver

Robocopy's speed depends on some options.

Robocopy 的速度取决于一些选项。

/Z option copies files in restart mode. When network goes down while copying, it resume next time. BUT with this option speed is not good.

/Z 选项以重新启动模式复制文件。复制时网络掉线,下次再恢复。但是这个选项速度不好。

/MT Creates multi-threaded copies with N threads. N must be an integer between 1 and 128. The default value for N is 8.

/MT 创建具有 N 个线程的多线程副本。N 必须是 1 到 128 之间的整数。 N 的默认值为 8。

Since you have ~Ks of files and local network, try to use more than default 8 threads (around 25) without /Z parameter.

由于您有 ~Ks 的文件和本地网络,请尝试在没有 /Z 参数的情况下使用超过默认的 8 个线程(大约 25 个)。

Also supressing file output increase speed.

还抑制文件输出提高速度。

robocopy source destination /MT:25 /NP /NFL /NDL

/NFL No file list - don't log file names

/NFL 无文件列表 - 不记录文件名

/NDL No directory list - don't log directory names

/NDL 无目录列表 - 不记录目录名称

With these options we copy millions of files with size above 1TB, and it can utilize all 1Gbit/sec network, so the limit is your network speed as you mentioned.

使用这些选项,我们可以复制数百万个大小超过 1TB 的文件,它可以利用所有 1Gbit/sec 网络,因此限制是您提到的网络速度。