Poor FTP performance when sourcing files from network share [Answered]RSS

10 replies

Last post Jun 17, 2011 05:12 AM by EyeContact

  • Poor FTP performance when sourcing files from network share

    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?

     

  • Re: Poor FTP performance when sourcing files from 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. 

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: Poor FTP performance when sourcing files from network share

    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. 

     

     

  • Re: Poor FTP performance when sourcing files from network 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.

  • Re: Poor FTP performance when sourcing files from network share

    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.

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: Poor FTP performance when sourcing files from network share

    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:

    http://technet.microsoft.com/en-us/library/cc781532.aspx 

    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. 


  • Re: Poor FTP performance when sourcing files from network share

    Apr 03, 2009 10:39 PM|steve schofield|LINK

    Thanks for posting the fix and update.

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: Poor FTP performance when sourcing files from network share

    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.

    Thanks

  • Re: Poor FTP performance when sourcing files from network share

    Jun 16, 2011 06:02 PM|EyeContact|LINK

    On our Windows 2008 server SP2 these registry keys don't exist. We do have the exact same problem so I'm wondering if there's another way to change these afd.sys settings in 2008 server?
  • Re: Poor FTP performance when sourcing files from network share

    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.

  • Re: Poor FTP performance when sourcing files from network share

    Jun 17, 2011 05:12 AM|EyeContact|LINK

    Thanks for informing me about creating the key slhungry! I did the same and set the value to 32768 and after rebooting the download speed indeed trippled from 6 mbps to 18 mbps. What value did you use?