commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel F. Savarese" <>
Subject Re: FTPClient.storeFile is very slow
Date Tue, 11 Dec 2007 06:11:34 GMT

In message <>, srinivas_nandula writes:
>I am using commons-net FTPClient utility to transfer files, sizes upto 50MB.
>When i try to transfer the file using the command prompt, the file transfers
>in 5 seconds. But when i use the FTPClient Utility, it takes about 1 minute.
>I set the BufferSize etc to about 8MB, but the result is the same. Can
>somebody suggest how i can improve the upload performance?

You probably don't want to use such a large buffer.  Something around the
size of a page of memory or a small multiple thereof should be sufficient
(e.g., 4k or 8k).  If downsizing your buffer doesn't help, try using
storeFileStream and writing your own loop to copy the data from one
stream to another.

Ideally, this sort of task would use sendfile, for which I suppose the
Java equivalent is FileChannel.transferTo, but Commons Net does not
yet make use of java.nio.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message