Windows 7 system uses multi-threading to speed up file copying? (1)

  
        Why can't I speed up the file copy/transfer function in Windows 7 under Windows 7? Multi-threaded file copy implementation can be implemented with robocopy.

regular file management operations friends, mentioned copy /paste operations, presumably a lot of people will recall the original copy of Vista excruciatingly slow speed, not satisfied with the built-in Windows system replication, because it is too The turtle is fast. So everyone used FastCopy, TeraCopy and other software to speed up the copy, Windows7 then fixed the problem, but the effect seems not ideal, but do you know that Windows7 has built-in fast copy function?

Solution:

suggest that if you want to copy a directory that contains multiple large files, it would need to use RoboCopy command, and it is a command-line directory replication command, since WindowsNT4. 0 started as part of the Windows Resource Kit, and then built into Windows Vista, Windows 7, and Windows Server 2008 as standard features. This tool not only copies very fast, but also supports breakpoint retransmissions, and even supports copying at scheduled time. . This feature in Windows 7 has also been upgraded. D?D can already support multi-threading, which means that the replication speed can be greatly improved. And this feature creates a full mirrored copy of two file structures without copying any unwanted duplicate files, while also allowing you to keep all relevant file information, including date and time stamps, security access control lists (ACLs), and more. The copying of N small file directories can increase the speed by an order of magnitude. Thousands of files are copied in 3 seconds, and the usual copy and paste method takes about 45 seconds.

example, take the disc F: //all the files in the directory are copied to the E //CD disk, you can run the following command:

Robocopy /sF: //E: //CD

even then suddenly remove the disc, anyway, robocopy will wait until the CD back into the drive will automatically begin copying.

Robocopy also supports LAN copy, even the directory structure of the LAN server in the specified directory of all adjourn to the local, robocopy support in timed operation, you can copy the operations carried out into the night, in order to avoid congestion LAN, to Others bring inconvenience.

check usage following this command, as shown below: The

: RoBoCopydir_fromdir_to /E /MT: 50 /LOG: copy.log

wherein /E means that the subdirectory is included, /MT:50 is 50 threads (the default is 8 threads, the maximum can be set to 128), /LOG is the redirected output. More options can be viewed with robocopy/?.

command syntax: ROBOCOPYsourcedestination [file [file] ...] [options]

source: the source directory (drive: //path or share ////////server path )

target: the target directory (drive: //path or share ////////server path)

file: to copy the file (name /wildcard: the default is " *. * ")

to test copy times, made the following test

can be seen from the above figure in a case where the threads 120, the copy size 878.16MB A single file, starting at 14:56:31, ending at 14:57:06, sharing 35 seconds.

recommended in order to be able to test how much can select the number of threads faster to copy files, copy time using PowerShell script batch-by-case test different threads of the required correspondence between the threads, and in plot points plotted on the coordinate, PowerShell test script as follows:

for (? $ i = 128; $ i Clt129; $ i ++) {

Robocopy /sC: //CDC: //test //CD $ i /MT: $ i /lOG: log /copy $ i.log

remove-itemC: ////test//CD$i//*.*
< BR> "$ i," & gt; & gt; log /answ.txt

(Get-ContentC: //log//copy$i.log-TotalCount6) [-1] & gt; & gt; log /answ.txt

"," & gt; & gt; log /answ.txt

(Get-ContentC: //log//copy$i.log-TotalCount10000) [-1] & gt ; & gt; log /answ.txt}

outputted through the contents of the script structured format, imported into Excel by CSV format, and make a line graph as shown in FIG. "series 1" line:

There are 324 files in the target directory of the copy. The size of a single file is between 1MB and 2MB. Between 549MB, the total file size is 549MB. Compared with the single file with the size of 878.16MB, the copying time is longer than before. Because of the large number of files, it takes a long time to copy one by one, and after many experiments. There will be errors in the normalization, as shown by the yellow "Linear (Series 1)" line in the figure, you can see that the same file group has different copy speeds when using different threads, with the thread As the number increases, the copying time decreases linearly.

In fact, there are many powerful robocopy to use, readers can use robocopy /? Command query or see more options RoboCopy command from the attachment end of this article, from which the reader will find this command more powerful Functional options.
Copyright © Windows knowledge All Rights Reserved