In relation to this question, http://forum.rebex.net/questions/173/how-to-optimize-transfer-performance-with-uploadbufferlength, we're still seeing slower ftp upload times than we'd like. The post mentions another option, UseLargeBuffers, which may be available. We'd be interested in this option.

I'm curious what the difference is between UploadBufferLength and the TcpClient.SendBuffer size. Looking at wireshark logs, it appears our send buffer is quite small, even though we've set the upload buffer length to 128k.

Thanks,

Mike

asked 13 May '10, 12:45

Michael%20Hamrah's gravatar image

Michael Hamrah
386
accept rate: 0%

edited 10 Aug '10, 13:22

Rebex%20KB's gravatar image

Rebex KB ♦♦
256312


The UploadBufferLength property simply controls how much data Rebex FTP passes to the TCP stack in a single request. Although passing 64KB chunks instead of 4KB chunks can make a big difference, this doesn't affect the underlying transport layers:

The TCP protocol runs over the IP protocol. Most Ethernet LANs use MTU (Maximum Transfer Unit) of 1500 bytes. The size of an IP packet header is 20 bytes and the size of a TCPv4 packet header is 20 bytes as well. This means that 1460 is often the maximum segment size that can be transferred in a single TCP packet over Ethernet II networks. (Protocols like PPPoE can reduce this further.)

On the other hand, the UseLargeBuffers option (currently only available in Rebex SFTP) sets (among other things) Socket.SendBufferSize (equivalent of TcpClient.SendBufferSize) to 256KB and Socket.ReceiveBufferSize to 4MB, which causes larger window size to be used by the TCP protocol for the socket, resulting in increased speed (and slightly increased memory requirements).

We will add this option to the next release Rebex FTP(/SSL) that should be released within a week!

Update: FtpOptions.UseLargeBuffers is available in Rebex FTP(/SSL) v3.0.3793.0.


At the moment, the value of Socket.SendBufferSize is not set explicitly, so it will be whatever the default value is. At my machine, it is 8192 (8KB). You can use the following code to determine the default buffer size at your machine:

using System.Net;
using System.Net.Sockets;

...

int sendBufferSize = new Socket(AddressFamily.InterNetwork,
    SocketType.Stream, ProtocolType.Tcp).SendBufferSize;
link

answered 13 May '10, 14:04

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.2k18
accept rate: 32%

edited 21 May '10, 13:31

Can you tell me what the default buffer size is now?

(13 May '10, 16:06) Michael Hamrah

Yes - I added this information to my original answer above.

(13 May '10, 16:52) Lukas Pokorny ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×136
×115
×5

Asked: 13 May '10, 12:45

Seen: 1,018 times

Last updated: 10 Aug '10, 13:22