IIS 5 & IIS 6
Poor FTP performance when sourcing files from network share
Last post Jun 17, 2011 05:12 AM by EyeContact
Feb 16, 2009 04:21 PM|barryhagan|LINK
We have encountered a performance problem with the IIS FTP server when it is configured to source files from a network share and the FTP client is on a network with high latency. This issue exists in both 2003/IIS6 and 2008/IIS7.
The maximum amount of data sent by the server in a given TCP window is restricted by how the IIS server reads the source file on the CIFS share.
When we configure the FTP server root as C:\Inetpub\ftproot, we get much higher transfer rates with the same network latency since we are able to fill the 64KB TCP window. Simply changing the root of the FTP site to
\\server\C$\inetpub\ftproot (share on the same computer!) kills performance. Using a sniffer we see the server sends chunks less than 4KB when using the share.
It seems like IIS uses a different buffer size depending on how the file is sourced (local vs. share). This is a problem if the latency between the FTP client and server is high.
Is there anyway we can tune the IIS FTP server to send larger chunks of files on a network share?
Feb 16, 2009 09:57 PM|steve schofield|LINK
Did you try the FTP 7.0 service or the built-in FTP service? BTW I've experienced the same thing and never found a workaround.
Windows Server MVP - IIS
Log archival solution
Install, Configure, Forget
Feb 16, 2009 11:40 PM|barryhagan|LINK
I've tried FTP 7.0 on 2008 instead of the version that shipped with the OS. It performed the same as IIS 6.0 on 2003. I've also tried adjusting some LanmanWorkstation settings on the server, but I have not found anything that changes how IIS reads the
files from the share.
Feb 17, 2009 02:19 PM|barryhagan|LINK
Some more info... After sniffing the server to network share traffic, It looks like IIS is buffering the FTP download when the file is on a network share.
We are seeing SMB2 reads in 32KB blocks from the IIS server on the network share. Then, the IIS server is only sending blocks around 4KB (Actually 3752 bytes) to the FTP client. Another strange behavior is that IIS reads the 32KB from the storage in two
requests - it requests 4KB and then immediately requests the remaining 28KB of the block.
I would hope there is a reg key somewhere that controls the buffering used by IIS FTP when sending files from shared storage. I'll probably open a support case with Microsoft soon unless someone knows how to change this behavior.
Feb 17, 2009 07:12 PM|steve schofield|LINK
Sounds like you have some good info. I would contact PSS. I'm not aware of a 'magic' registry key.
Apr 01, 2009 10:31 AM|barryhagan|LINK
I finally got my support case escalated to an engineer that had the answer.
When the IIS FTP server sends a file, it passes this work down to Afd.sys (kernel-mode driver for winsock).
There are registry settings that control the behavior of AFD:
In particular, TransmitIOLength is used when the file is cached, and LargeBufferSize is used when the file is not cached. Adjusting the LargeBufferSize parameter resolved my issues with high latency FTP clients - In my experience the default value of 4K
is way too small if you have anything over 50ms of latency.
Apr 03, 2009 10:39 PM|steve schofield|LINK
Thanks for posting the fix and update.
May 25, 2011 06:09 PM|slhungry|LINK
Thanks for posting this. I'm curious what value you used for LargeBufferSize? I know it could be different for different people, but just curious what most people use.
Jun 16, 2011 06:02 PM|EyeContact|LINK
Jun 16, 2011 06:25 PM|slhungry|LINK
the key didn't exist for me either. i had to create it and rebooted. it worked fine afterwards.
Jun 17, 2011 05:12 AM|EyeContact|LINK