How to improve the Performance of FtpWebRequest?

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

    i was working a few days with that... and speed was really low, nothing to compare with FileZilla... finally i solved with multithreads. 10 threads making connections for download gives me a good rate, maybe even could be improved more.. with a standar ftprequest configuration

    PeticionFTP.ConnectionGroupName = "MyGroupName"
    PeticionFTP.ServicePoint.ConnectionLimit = 4
    PeticionFTP.ServicePoint.CloseConnectionGroup("MyGroupName")
    
    PeticionFTP.KeepAlive = False 
    PeticionFTP.UsePassive = False
    
    PeticionFTP.UseBinary = True
    
    PeticionFTP.Credentials = New NetworkCredential(lHost.User, lHost.Password)
    

提交回复
热议问题