When UseLargeBuffers
option is enabled, the TCP socket's receive buffer length is set to 4MB and send buffer length is set to 256KB. Without this option, default values are used instead. In addition to this, a 2MB receive buffer is allocated for an SSH channel with UseLargeBuffers
(128KB without the option).
Regardless the option, an internal buffer of 32KB is allocated for SFTP session and 32KB/50KB buffers are allocated for the underlying SSH session.
PutFile
- an internal buffer of 28KB is allocated for each transfer.
GetFile
- no additional per/transfer buffer.
GetStream
/ Write
- no additional per/transfer buffer.
GetStream
/ Read
- a receive buffer (same size as number of received bytes) is allocated for each read call.
Advice: UseLargeBuffer
only offers noticable advantages in some network configurations. In your case, disabling it might be more useful than keeping it. Also, when using the GetStream
method, read/write operations are noticably slower than when using GetFile
/PutFile
methods - check out this Q&A for details.