You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Lee Albas (JIRA)" <ji...@apache.org> on 2012/12/23 07:12:13 UTC
[jira] [Commented] (NET-493) FTPClient: Slow data transfer rate if
__bufferSize != 0
[ https://issues.apache.org/jira/browse/NET-493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13538976#comment-13538976 ]
Lee Albas commented on NET-493:
-------------------------------
I've come across this as well. It might be a deeper underlying issue with Java 7 (or, worst case, my issue differs from yours). Are you using Java 7? My FTP code functions just fine in Java 6 whether I use the Apache Commons Net or Sun Net libraries, but when I switch to Java 7, both slow down dramatically (about 100 times slower, e.g. 800Kb/s in J6 becomes 8.0KB/s in J7). As you've already done, setting the buffer state to 0 returned things to normal for the Apache library. Unfortunately, for the Java 7 Sun lib, there was no similar setting. Profiling my program I detect that it spent an inordinate amount of time executing within the Sun RMI-TCP section; perhaps that's where the underlying problem lies.
Thanks for putting this on watch!
> FTPClient: Slow data transfer rate if __bufferSize != 0
> -------------------------------------------------------
>
> Key: NET-493
> URL: https://issues.apache.org/jira/browse/NET-493
> Project: Commons Net
> Issue Type: Bug
> Components: FTP
> Affects Versions: 3.2
> Environment: Windows 7 32bit / Windows XP 32bit
> Reporter: Mico Micic
> Labels: ftpclient
> Attachments: screenshot-1.jpg, screenshot-2.jpg
>
>
> The patch applied in [NET-465|https://issues.apache.org/jira/browse/NET-465] causes a very slow data transfer rate. The line {code}850: socket.setSendBufferSize(__bufferSize){code} in {code}_openDataConnection_{code} sets the buffer size to 1024 by default. With this size I had a very bad transfer rate on windows 7 and XP. The wireshark log shows that each FTP-DATA packet is exactly 1024 bytes long and has to be acknowledged on the TCP layer before the next one is sent. I don't know why, but when I set the buffer size to 0 (FTPClient.setBufferSize) the transfer rate is fine.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira