How can I improve FTP upload speed for multiple files
posted 2 years ago
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.