How to improve the Performance of FtpWebRequest?

后端 未结 18 1136
忘掉有多难
忘掉有多难 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:32

    I did some benchmarks on FtpWebRequest, similar to @Sid 's response above. Setting KeepAlive to true does improve, but not the asynchronous calls in my test. The test consists of

    1) FtpWebRequest for check of file existence 2) FtpWebRequest for upload 3) FtpWebRequest for rename file on server

    Test FTP client 30 files of size 5 Kbytes took ... 14.897 seconds Test upload (alive true, connection name) 30 files of size 5 Kbytes took ... 34.229 seconds Test async(alive true, connection name) 30 files of size 5 Kbytes took ... 40.659 seconds Test send thread (alive true, connection name) 30 files of size 5 Kbytes took ... 38.926 seconds, 30 files

    what did improve was an implementation of an FTP client made using the Socket class

    the benchmark is here

    https://github.com/pedro-vicente/ftp_t

提交回复
热议问题