Debug Network
A few tricks for simple network debugging:
- Check the response times when you ping the FTP server from the application server.
- Check the response times for a trace route (
tracert
from a DOS shell).
- Transfer a file from the command-line using the
ftp
command.
- Connect to the FTP server via Telnet:
telnet server 21
.
The results will provide clues to solving the problem.
Network Hardware
For a slow trace route:
- Determine why the two computers are having network issues.
- Upgrade the network hardware between the slowest link.
Network Configuration
For a slow ping:
- Check the network configuration on each machine.
- Ensure the settings are optimal.
Validate API
A slow command-line FTP session will tell you that the problem is not isolated to the FTP API you are using. It does not eliminate the API as a potential problem, but certainly makes it less likely.
Network Errors
If packets are being dropped between the source and destination, ping will tell you. You might have to increase the packet size to 1500 bytes to see any errors.
FTP Queue Server
If you have no control over the destination FTP server, have an intermediary server receive uploaded files. The intermediary then sends the files to the remote server at whatever speed it can. This gives the illusion that the files are being sent quickly. However, if the files must exist on the remote server as soon as they are uploaded, then this solution might not be viable.
FTP Server Software
Use a different FTP daemon on the FTP server, such as ProFTPd as a Windows service. (ProFTPd has plug-ins for various databases that allow authentication using SQL queries.)
FTP Server Operating System
A Unix-based operating system might be a better option than a Microsoft-based one.
FTP Client Software
There are a number of different APIs for sending and receiving files via FTP. It might take some work to make your application modular enough that you can simply plug in a new file transfer service. A few different APIs are listed as answers here.
Alternate Protocol
If FTP is not an absolute requirement, try:
- a Windows network drive
- HTTPS
- scp, rsync, or similar programs (Cygwin might be required)