This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes How can I improve FTP upload speed for multiple files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "How can I improve FTP upload speed for multiple files" Watch "How can I improve FTP upload speed for multiple files" New topic
Author

How can I improve FTP upload speed for multiple files

Urairat Yusuk
Greenhorn

Joined: Jul 08, 2013
Posts: 1
I implemented java code to upload files to server with org.apache.commons.net.ftp.FTPClient.

Following is example code:


When I uploaded 1500 files (each file is about 1-20 KB),it took about 49406 - 51000 millisec (This is upload time only).
I would like to improve the speed.

How should I do?

-Change library? What is the powerful FTP client class library for uploading multiple files?
Some people suggest me to use ftp4j, but when I test the library with 1500 files, the upload speed of ftp4j is slowly than FTPClient. It took about 60000 millisec

Following is a sample ftp4j code:


-Use multiple threads? How can I implement ftp upload function with multiple threads? Could someone show me an example? I am a new for multiple threading programming.

I try to use multiple threads like following code:



Is it correct? It work correctly but it cannot improve speed. It took about 49000 - 51000 millisec same as the code without thread

PS. I test the speed with intranet. It will take more time for internet.

Somebody can help me?


Thanks in advance
Urairat
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I improve FTP upload speed for multiple files