[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A performance question (fwd)



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>

Hello Roberto,

When you have questions about FTPAPI, please send them to the FTPAPI mailing list, which is the correct place for both FTPAPI and HTTPAPI questions. To do that, send your question to ftpapi@xxxxxxxxxxxxx
My response is below:



I have to move (download and delete) a great number of files from severals
ftp servers to another big server. The name of that files had to be saved in
a DB2 file.

I see that I can use two methods, the first one is that of TESTMGET example
and the second is that of TEST2SESS.

What is the difference of the two methods? And what about the performance of
the two methods?

TESTMGET downloads the filenames into an array, then uses the array to GET each file from the server. In your situation, you'd also want to call a program that processes the file, and if that's successful, delete the file from the server. Unless it's an interactive process, I'd suggest processing it before deleting in just to be sure that there isn't a problem.


TEST2SESS does the same thing, but instead of saving the filenames into an array, it makes two connections to the FTP server. One connection requests the list of files, and then the other connection is used to perform the download.

With TESTMGET you need to know the maximum number of files that can be in the directory, because you have to declare an array that's large enough to store them all. With TEST2SESS, this isn't an issue, since one session downloads the filenames, and each time it receives one, it executes the download in the other session.

TEST2SESS has to stop the directory listing while it's downloading each file, and then continue it. This means that there's a chance that the server will say "sorry, you took too long" when downloading the directory, and that will cause it to fail. Consequently, TEST2SESS should only be used when the files to be downloaded are small and can be retrieved very quickly.

Which one performs better? I would think that TESTMGET would perform slightly better because it establishes one fewer connection than TEST2SESS does. However, I don't think you'll find this to be a significant difference.
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------