Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.7.1
-
None
-
None
-
Java 8, FTP server on z/OS | z/VM
Description
Performance issue when using the FTPClient to retrieve files from z/OS and z/VMPerformance issue when using the FTPClient to retrieve files from z/OS and z/VM
There is a significant performance drop off when using the FTPClient to retrieve files from z/OS and z/VM ( I haven't tested against other operating systems). If I switch to using the FTPSClient I don't see the same problem.
The following is the command output when doing a retrieve of a file from z/OS which is only 2.0KB in size:
FTPClient:
2020-10-07 08:30:46.261 SENT>>> RETR
2020-10-07 08:30:46.291 RECD<<< 125 Sending data set TEST.FTP(PART11B) FIXrecfm 80
2020-10-07 08:32:46.342 RECD<<< 250 Transfer completed successfully.
FTPSClient:
2020-10-07 08:30:45.813 SENT>>> RETR
2020-10-07 08:30:45.843 RECD<<< 125 Sending data set TEST.FTP(PART11B) FIXrecfm 80
2020-10-07 08:30:46.014 RECD<<< 250 Transfer completed successfully.
The first transfer using the FTPClient took 2 minutes, which when switching to using FTPS take less than a second. This has only been an issue since upgrading from commons-net 3.6 to 3.7.1. It seems to consistently take 2 minutes transfer pretty much regardless of the size of the file, so appears to be waiting on something or hitting a timeout of some sort.
I have added the code I'm using to establish the FTPClient and connect to the host and to retrieve the file.
//Establish the FTPClient and connect to the host private FTPClient getFTPClient(String host, String userProperty, String passwordProperty) throws SocketException, IOException { FTPClient client = new FTPClient(); client.addProtocolCommandListener(this); client.connect(host); client.login(getProperties().getProperty(userProperty), getProperties().getProperty(passwordProperty)); client.enterLocalPassiveMode(); return client; } //Retrieve file private void getFile(String remoteDir,String localDir, String file, FTPClient client) throws IOException, FileNotFoundException { client.changeWorkingDirectory(remoteDir); client.setFileType(FTP.BINARY_FILE_TYPE); BufferedOutputStream bo = new BufferedOutputStream(new FileOutputStream(localDir + file)); client.retrieveFile(file, bo); bo.close(); }