Troubleshooting a tricky performance problem and wondering if this behavior is normal/expected.
This seems to be related to SMB2, as switching to SMB1 resolves things. The question is whether this is expected (i.e. design of SMB2) and, if so, is there a solution/workaround?
Here’s a simplified version of the problem:
1.Connect two Windows 7 machines via crossover cable.
2.Start a large file copy.
3.While that copy is underway, start a small file copy. The second copy process is very slow.
4.However, if you instead connect to the other machine “another” way (i.e. via IP instead of FQDN, or via Netbios name instead of IP, etc.), copy performance is relatively good.
It appears that the large copy is “bottlenecking” the original connection – i.e. as soon as you pause the large copy, the small copy finishes quickly.
It’s not saturating the bandwidth/stack completely though (since the second copy via a "different connection” finishes quickly).
How to reproduce the problem:
I've created some batch files that demonstrate this (all the code is listed at the bottom of the question – you need to create 5 separate batch files called go.bat, test.bat, copy1.bat, copy2.bat, copybig.bat):
Setup:
- Create test directory on remote ComputerB (c:\test)
- Create test directory on local ComputerA (c:\test)
- Put the 5 test batch files in ComputerA’s c:\test directory
- Edit go.bat and modify the last line as follows: The format is “call test.bat 1 2 3”, where: 1 = remote path via hostname 2 = local folder 3 = remote path via IP (e.g.: call test.bat \\ComputerB\c$\test c:\test \\ComputerB’sIPAddress\c$\test)
Execution:
- Open a command prompt as an administrator (so it can create the empty test files) and run go.bat
Here’s what the batch files do:
-Checks ComputerA to see if the three files exist (1GB, 10MB-1, 10MB-2) . If the files aren’t there, creates them.
-Deletes the local log file and ComputerB test files
-Starts copying the 1GB file from ComputerA to ComputerB
-Waits two seconds
-Starts copying the 10MB-1 file from ComputerA to ComputerB
-Starts copying the 10MB-2 file from ComputerA to ComputerB (but using its IP address)
-Logs, with timestamps, what’s happening to log.txt
Results:
What seems to happen consistently is this:
-The big 1GB file copy establishes a connection with the remote machine
-The small 10MB-1 file copy starts and eventually finishes but is really slow because it’s “sharing” the existing connection with the 1GB copy connection
-The small 10MB-2 file copy that uses the IP address finishes quickly because it establishes a “new/separate” connection
-At any point, if you hit pause during the big copy, the small 10MB-1 copy finishes quickly.
Batch file code:
--go.bat--clsrem The format is test.bat 1 2 3, where:rem 1 = destination path with hostnamerem 2 = local pathrem 3 = destination path with IPcall test.bat \\ComputerB\c$\test c:\test \\ComputerB'sIP\c$\test--go.bat----test.bat--if exist %2\1GB goto 1fsutil file createnew 1GB 1048576000:1if exist %2\10MB-1 goto 2fsutil file createnew 10MB-1 10485760:2if exist %2\10MB-2 goto 3fsutil file createnew 10MB-2 10485760:3del /q /f log.txtdel /q /f %1\10MB-1del /q /f %1\10MB-2del /q /f %1\1GBset var1=%1set var2=%2set var3=%3echo Calling CopyBig.bat %time% >> log.txtstart CopyBig.bat %var1% %var2% %var3%echo Pausing for two seconds %time% >> log.txtping 127.0.0.1 -n 3echo Calling Copy1.bat %time% >> log.txtstart copy1.bat %var1% %var2% %var3%echo Calling Copy2.bat %time% >> log.txtstart copy2.bat %var1% %var2% %var3%--test.bat----copybig.bat--echo Starting Big Robocopy %time% >> log.txtrobocopy %2 %1 1GBecho Done Big Robocopy %time% >> log.txt--copybig.bat----copy1.bat--echo Starting 1st Robocopy %time% >> log.txtrobocopy %2 %1 10MB-1echo Done 1st Robocopy %time% >> log.txt--copy1.bat----copy2.bat--echo Starting 2nd Robocopy %time% >> log.txtrobocopy %2 %3 10MB-2echo Done 2nd Robocopy %time% >> log.txt--copy2.bat--