Sftpfile stream is very slow it took 1hr 15 mins for 400mb file.
Is there any way to increase the read buffer of the sftpfilestream.
sftp.buffersize is for upload i believe. But i tried changing it no luck.
Comments: ** Comment from web user: drieseng **
Is there any way to increase the read buffer of the sftpfilestream.
sftp.buffersize is for upload i believe. But i tried changing it no luck.
Comments: ** Comment from web user: drieseng **
I did some tests myself, and SftpFileStream (SftpClient.OpenRead) is about twice as slow as DownloadFile:
DownloadFile (BufferSize=14000): 2100 Kb/s
DownloadFile (BufferSize=16384): 1500 Kb/s
OpenRead (Buffer=14000): 900 Kb/s
DownloadFile (Buffer=16384): 950 Kb/s
I'm gonna try to look into this later today.
I'll also be reducing logging, as that increases throughput by 100%.
For now, you may want to consider using DownloadFile with a FileStream, and lowering the BufferSize to 14000.