my dog learned polymorphism
The moose likes Sockets and Internet Protocols and the fly likes FTP very slow Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "FTP very slow" Watch "FTP very slow" New topic

FTP very slow

Tom Simmons

Joined: Nov 16, 2010
Posts: 11
Afternoon All

Not quite sure if this is the right forum section...

I need to implement FTP transfer in a program I support. First time playing with FTP in Java so I knocked up a quick program see what was needed and got some disappoiting results.

If I use FileZilla or the DOS bases FTP command to transfer the 2.37MB test file, it takes about 6 seconds. Using either Commons Net of I get 20-30 seconds.

Can anyone shed any light on why there is such a difference?

Apologies for the huge post, but it wouldn't let me attach .java, .txt or .zip files!


Commons Appraoch

Sun Approach

Tom Simmons

Joined: Nov 16, 2010
Posts: 11
Having installed Wireshark I think I might have found something...

With Wireshark I was able to see that when using FileZilla each dollop of data sent was 1360 bytes, however checked the Java approaches the dollops ranged from 688 to 1360 bytes.

I tried adding a buffered read, just in case...

It made no difference.

I agree. Here's the link:
subject: FTP very slow
It's not a secret anymore!