Usage
Client Usage

The "-O" option enables Auto Tuning.

The client measures the optimal window (socket buffer) size by exchanging a burst of ICMP echo/reply packets with the server, and sets its sending and receiving socket buffer sizes to this optimal value.

It then informs the server of this optimal buffer size. The server responds by setting its own sending and receiving socket buffer sizes to this optimal value. This optimizes file transfer speeds.

When used at the time of opening an FTP session, the "-O" option enables optimal buffer size measurement automatically throughout the session, once in the beginning, and once before every file transfer (get/put) thereafter, without further ado.

For example,

    $ncftp -u   -O 

or,

    $ncftp

    NcFTP 3.0.1 (March 27, 2000) by Mike Gleason (ncftp@ncftp.com).

    ncftp> open -u  -O 


Both of the above ensure that every file transfer during the duration of this ftp session uses only the optimal sending and receiving window sizes calculated just preceeding the file transfer.

Optionally, if you anticipate that you are not going to be transferring a large number of specially huge files, and that the time spent making optimal buffer size measurements would be an overhead best avoided, then you might omit using the "-O" option at the time of opening a session.

Instead, you might then use the "-O" option along with each individual file transfer as shown below.

    $ncftp -u  

    ncftp /home/ > ls

    file1

    file2

    ncftp /home/ > get -O file1

    Optimal Socket Buffer Size Set To [35280] bytes.

    file3:                    15 MB        1.23 MB/s

    ncftp /home/ > !ls

    file3

    ncftp /home/ > put -O file3

    Optimal Socket Buffer Size Set To [39012] bytes.

    file3:                    18 MB        1.36 MB/s

    .

    .


Apart from automatic tuning, the "set so-bufsize" option allows manual setting of the socket buffer size.

For example, after making an ftp connection..
 

    ncftp /home/ > set so-bufsize

    so-bufsize 35280

    ncftp /home/ > set so-bufsize 100000

    Optimal Socket Buffer Size Set To [100000] bytes.

    ncftp /home/ > set so-bufsize

    so-bufsize 100000

    ncftp /home/ >

    .

    .


As shown above, you can also use the "set so-bufsize" without any argument to find out the socket buffer size being used by the client. [Note: the set so-bufsize command will have no effect if there is no current ftp session]

If the server does not support the SITE BUFSIZE  feature, then the client lets the user know. The client however sets its own buffer sizes to this new optimal or user-provided value irrespective of the server's capability.
 

    ncftp /home/ > get -O file1

    Optimal Socket Buffer Size Set To [40000] bytes.

    Server [] Could Not Set Optimal Buffer Size

    Continuing normally...

    file1:                    6 MB            1.5 MB/s

    ncftp /home/ >

    ncftp /home/ > set so-bufsize 200000

    Optimal Socket Buffer Size Set To [200000] bytes.

    Server [] Could Not Set Optimal Buffer Size

    Continuing normally...

    ncftp /home/ >