Issue with ftp hanging


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Issue with ftp hanging
# 1  
Old 06-29-2015
Issue with ftp hanging

I could have sworn I posted on this issue earlier a couple of weeks ago but now cannot find the thread to add some updated info so I guess I'll start from scratch.

Running on Oracle Linux 5.6, 64-bit.

I have a weekly job that does an ftp 'mget' to copy a bunch of files from a production server to a test server. The two servers are in two different data centers. One DC has all of our test servers and theoretically would be our disaster recovery location. The other DC has all the production servers. The script has been working flawlessly for years - until .....

We relocated the production DC. With that relocation we got a less reliable and lower bandwidth wireless (microwave ?) link between the two DC's.

Since the DC move, I have not had a successful ftp operation. In every case, it will successfully connect and copy several files, but eventually it will get to a file and just hang. When it hangs, it is not on the first file and it is not on the last file, so the issue has nothing to do with authorization or fundamental connectivity, nor does it have to do with housekeeping of getting started with the overall operation or getting it all wrapped up at the end.

A couple of other 'odd' observations:

1 - For a given set of files to be transferred, once the operation hangs, any repeated attempts hang on the same file.

2 - Each week it is working with an entirely different (newly created since the last week) set of files, so obviously hangs on a different file than the previous week, but see point 1.

3) I have a completely different pair of prod/test servers on which I occasionally have to do the same sort of ftp operation on demand rather than on schedule. It copies a much smaller set of files but exhibits the same 'hanging' behavior.

4) In order to get the real work done, I switched from ftp to scp. With that I can get the files copied and do the work needed, but it is taking much longer. The ftp - when it worked - took between 90 and 120 minutes. With scp it is taking between 6 and 7 hours. I do not know if this time difference is purely due to the bandwidth -- if ftp would now take as long if I could get it to work at all.

My primary question is what could be up with the 'hanging' issue in ftp, and how do I go about resolving it?
# 2  
Old 06-29-2015
Does the moved DC have a new IP that has not been ajusted in the /etc/hosts?

Definition of hang - infinite, if a 5kb file takes 2 hrs.
As it is the same file (within the same week), how large is the file that hangs?
If it is larger than 4gb, what is the destination underlying filesystem (eg: ext4, ntfs, fat)?

not that much experience, but hth & gl
# 3  
Old 06-29-2015
A couple of questions to consider:-
  • Is the file being read a pipe rather than a plain file by any chance?
    If so, it will be waiting for input and an end-of-file to be written to the pipe file.
  • Are there any errors returned or does the whole thing just stop?
  • Are the network errors? Small files might be okay, but larger ones might cause it to go extremely slowly (seemingly infinite) I have experienced this when a switch forced a connection to 100Mb full-duplex but he card could only run at 10Mb half-duplex.



Maybe investigating these might help,
Robin
# 4  
Old 06-29-2015
Since the problem occurred after relocation I'd be inclined to suspect the network. I'd write a script to ping the target, say, every 10 seconds (to avoid too much artificial network traffic) and leave it running in front of me. When the ftp 'hangs' is the ping still fast????
# 5  
Old 06-29-2015
sea -

All of the files are in the 1 to 4 gb range. Most of them are right at 4gb. When tailing the log file, the ones that complete do so in a couple of minutes at most. I can't wait 'forever' but when the next one goes two hours without any progress, I'd call that a 'hang'. If it were the underlying FS, it should have presented problems prior to the DC move, and the scp copy should have the same issue. No, the only variable here is the network connection, and perhaps ftp's reaction to it. Given the apparent reduction in bandwidth, I'd expect it to be slower, but I wouldn't expect ftp to grind to a complete halt, while scp is able to do the same work.

---------- Post updated at 02:12 PM ---------- Previous update was at 02:06 PM ----------

Robin -
1 - no pipes, just plain files.
2 - no errors returned ... it just grinds to a halt. Before it does so, I tail -f the file and watch things go by. I can also see the time stamp on the file (ls -l) progressing every couple of minutes as it completes another file and writes the info about it. Then everything just stops moving.
3 - No network errors that I know how to log (I'm DBA, not Net Admin) but I'm willing to take a look if someone can tell me where.
3a - most of the files are at 4gb. Several of them move just fine, so it can't be file size alone, though I could see that being a 'necessary but not sufficient' component of the problem. I don't know about the possibility of the network speed and duplex switch, but I'll take that up with the Net Admin. Thanks for the idea.

---------- Post updated at 02:14 PM ---------- Previous update was at 02:12 PM ----------

Quote:
Originally Posted by hicksd8
Since the problem occurred after relocation I'd be inclined to suspect the network. I'd write a script to ping the target, say, every 10 seconds (to avoid too much artificial network traffic) and leave it running in front of me. When the ftp 'hangs' is the ping still fast????
Good idea. I'll try to set up a test.
# 6  
Old 06-29-2015
@edstevens......We are discussing network performance here so, for the avoidance of doubt, there is no Windoze involved in this, is there? We are talking Oracle Linux here, yes?
# 7  
Old 06-30-2015
Quote:
Originally Posted by hicksd8
@edstevens......We are discussing network performance here so, for the avoidance of doubt, there is no Windoze involved in this, is there? We are talking Oracle Linux here, yes?
No Windows at all (thankfully Smilie) Both servers are Oracle Linux.

---------- Post updated at 01:06 PM ---------- Previous update was at 08:09 AM ----------

Quote:
Originally Posted by hicksd8
Since the problem occurred after relocation I'd be inclined to suspect the network. I'd write a script to ping the target, say, every 10 seconds (to avoid too much artificial network traffic) and leave it running in front of me. When the ftp 'hangs' is the ping still fast????
Ok, here's what I did and what I found ..
First, a script to capture some good ping statistics

Code:
#!/bin/sh
rm edspingtest.log
echo starting first ping at `date`
ping -c 20 -i 10 myprodserver >> edspingtest.log
echo Starting ftp job at `date`
echo Starting ftp job at `date` >> edspingtest.log
nohup /u01/app/oracle/dba/eds_ftp_test > /backup/eds_ftp_test.log &
echo starting second ping at `date`
ping -c 20 -i 10 myprodserver >> edspingtest.log

The summary stats of the first 20 pings (before launching the ftp):

Code:
rtt min/avg/max/mdev = 0.155/0.595/4.702/1.036 ms

And the 20 pings during the ftp:

Code:
rtt min/avg/max/mdev = 0.157/2.266/16.610/4.356 ms

So there was a significant difference. Not sure what to do with that information.

By way of comparison, a simple 'ping -c 50' from the same test server to a different test server (same data center, so not using the link between DC's) yielded these stats:

Code:
rtt min/avg/max/mdev = 0.081/0.124/1.136/0.171 ms

So at "the end of the day", it's obvious that the data link between the two dC's is rather slow, and there's nothing I can do about that. I can (and probably should) get the files copied with scp instead of ftp. But I still find it puzzling that the ftp should completely hang the way it does.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ftp issue

I have logged into ftp and unable to enter into the below directory. can anyone help me out to enter into the below directory. ftp> dir 200 Command PORT okay. 150 File status okay; about to open data connection. drwx------ 0 0 Dec 15 06:39 BANK ISI-Bas ftp> cd BANK... (5 Replies)
Discussion started by: ramkumar15
5 Replies

2. Shell Programming and Scripting

Connecting to a server using FTP is hanging

Hi Friends I have created a shell script to connect to a windows server. But the problem is while trying to run the script I am not getting any output. After running the script it is hanged and the prompt is not showing until if I press the ctrl+Z to break the script. I also tried using the FTP... (2 Replies)
Discussion started by: Kannannair
2 Replies

3. UNIX for Advanced & Expert Users

Ftp issue

Hi we are facing an issue on our server our job connects to a target server and pulls the file from a location .But it is taking too much time to do this . Hwne i manully do the ftp it finished in few seconds .but when the jobs is pulling it is taking 30 to 40 min . please see the log... (1 Reply)
Discussion started by: ptappeta
1 Replies

4. Shell Programming and Scripting

ftp issue

Hi again, I'm using the following shell script via cron to upload the daily log files from my shell to the web server so we can view them online. But somehow logs get corrupted and i don't know what's issue. I would really appreciate for your help please. Shell Script: ftp.sh #!/bin/sh... (3 Replies)
Discussion started by: user`
3 Replies

5. UNIX for Dummies Questions & Answers

FTP Issue

Hi all, iam trying to connect to a ftp site in putty by using the follwing command . ftp URLname. I get the below error ftp: usftp.ABC.com: unknown host. Iam able to connect to the same site through windows commandline. Can anyone put your thoughts on what might be the issue?. ... (2 Replies)
Discussion started by: swathich
2 Replies

6. IP Networking

FTP issue

Hello all, FTP times out when I transfer large files. Small files get transffered fine. small files -------- -bash-3.1$ ftp -i cldevoradb01 Connected to cldevoradb01.enterprisenet.org. 220 (vsFTPd 2.0.5) 530 Please login with USER and PASS. 530 Please login with USER and PASS.... (4 Replies)
Discussion started by: luft
4 Replies

7. Shell Programming and Scripting

FTP client is hanging very rarely!

Hi, I have a script in which I am using ftp to transfer some files from remote -> local and vice versa, this scripts is invoked by cron. for your reference I am sharing the function also : ============================================= fn_FileTransfer_LocalToRemote() { set -x... (1 Reply)
Discussion started by: anshuman0507
1 Replies

8. Shell Programming and Scripting

FTP Issue-Help

Hi all, I am trying to transfer files from one server to another. Following is script i wrote for this purpose. It downloads the file to the server which the script is residing and uploads it to the remote server. Main Script #!/bin/bash -x ... (2 Replies)
Discussion started by: Tuxidow
2 Replies

9. Shell Programming and Scripting

ftp issue

I was changing a bit of the existing script and didnt comment the ftp part in it. So, the ftp step executed, but there was no input file. I got the message like this netout: write returned 0? 250 Transfer completed successfully. What does this mean?. Has the ftp replaced the existing... (1 Reply)
Discussion started by: dnat
1 Replies

10. Shell Programming and Scripting

ftp issue

Hi all, I am trying to connect to ftp through the following shell script ip='172.12.40.45' user='oracele' pw='oracle@7Hills' ftp -n -i -v $ip<<EOF user $user $pw EOF But i am getting the following message $ /home/oracle/practice/ftptst Connected to 172.12.40.45. 220 (vsFTPd... (5 Replies)
Discussion started by: ravi raj kumar
5 Replies
Login or Register to Ask a Question