How to improve the Performance of FtpWebRequest?

后端 未结 18 1121
忘掉有多难
忘掉有多难 2020-11-28 04:46

I have an application written in .NET 3.5 that uses FTP to upload/download files from a server. The app works fine but there are performance issues:

  1. It take

18条回答
  •  粉色の甜心
    2020-11-28 05:27

    I know it's an old thread, but I recently had to go through a similar situation.

    We needed to download 70+ XML files from an ftp server in under 25 minutes without opening more than 5 connections during that time-frame.

    These were all the alternatives we tried:

    • wget - It was fast, but every GET meant a new connection. We had to stop due to the amount of connections created. We were having some issues with GETM that's well-documented in the web so that wasn't an option.
    • FtpWebRequest - Every Create call would log a new connection, even though we used the KeepAlive and ConnectionGroupName properties. Plus it was very slow.
    • Webclient - We didn't check if it created a new connection for every file (although I assume it does), but it copied 1 file/minute. So it wasn't an option.

    We ended up using old-fashioned ftp batch script. It's fast and I only use one connection to download all the files. It isn't flexible, but it's much faster than everything else I've tried (75 files in under 20 minutes).

提交回复
热议问题