Slow network file copy on Windows 7
I wrote a program that uses xcopy to transfer files (usually between 1KB and 2MB) over our intranet. Usually, I am copying files from my host machine (Windows 7 x64) to a VMWare virtual machine running Windows Server 2008 (the VM is running on my host machine, if that matters).
On Windows XP, the file transfers usually only require a few seconds to complete. But on my Windows 7 machine, the transfer of the first file (1.5 MB) takes around 1.5 minutes to complete. This is true whether I use xcopy, robocopy, or programmatically using File.Copy(). I noticed that if I use File.Copy, the first transfer is very slow and subsequent transfers are much faster.
Any clue how I can speed up the process? Is there a setting in Windows 7 (or server 2008) that I could try?
I found a good lead on another board ( http://social.technet.microsoft.com/Forums/en/w7itpronetworking/thread/c30f6649-a0d9-4f5e-8671-904a8f5469bb ). Since the problem had a lot of leads which didn't work, I thought I'd cross-post a solution that worked for me.
Specifically, my problem was that file transfers FROM Windows 7 to XP were slow, measured by seeing network utilization in the Task Manager at about 1%. Transfers from XP to Windows 7 typically used 80-99% of the network bandwidth. These results were achieved whether the transfer was "push" or "pull".
What worked for me: I went to Local Area Network properties, Configure, Advanced Tab, and disabled Large Send Offload v2. The advice to disable autotuning, RSS, set Speed & Duplex to a specific value, remove from homegroup, did nothing. Ultimately, the settings which worked on my Dell XPS 8100 Windows 7 Pro 64-bit workstation were as follows:
ARP Offload - Enable
Ethernet@WireSpeed -Enable
Flow Control - Auto
Interrupt Modulation - Enable
IPv4 Checksum Offload - Rx & Tx Enabled
Large Send Offload (IPv4) - Enable
Large Send Offload v2 (IPv4) - Disable
Large Send Offload v2 (IPv6) - Disable
Network Address - Not present (radio button)
NS Offload - Enable
Priority & VLAN- Priority & VLAN Enabled
Receive Side Scaling - Enable
RSS Queues - RSS 4 Queues
Speed & Duplex - Auto
TCP & UDP Checksum Offload (IPv4) - Rx & Tx Enabled
TCP & UDP Checksum Offload (IPv6) - Rx & Tx Enabled
VLAN ID - 0 Wake Up Capabilities -
Both WOL Speed - Lowest Speed Advertised
Hope this proves helpful to someone else.
Consider turning off Remote Differential Compression as per this article: http://www.windowsreference.com/windows-7/slow-network-file-copy-issues-in-windows-7-caused-by-remote-differential-compression/
EDIT: You can read up on the specifics of Remote Differential Compression here: http://msdn.microsoft.com/en-us/library/aa372948(VS.85).aspx
This kind of slowness is usually caused by a misbehaving\misconfigured network interface. If the auto negotiation between the network interface and the switch doesn't work properly( and often this is the case) the network interface will use wrong duplex setting. Somehow it allows network traffic to flow but very slowly. Check the NIC configuration and the network port configuration and make sure they are synchronized.