Performance issue with ftp script.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Performance issue with ftp script.
# 1  
Old 08-20-2007
Performance issue with ftp script.

Hi All,

I have written a script to FTP files from local server to remote server. When i try it for few number of files the scripts runs successfully. But the same script when i run for 200-300 files it gives me performanace issue by aborting the connection.

Please help me out to improve the performance. Script is working fine with respect to functionality.

Thanks.
# 2  
Old 08-20-2007
This is from the wu-ftpd man page .

Code:
The ftp server will timeout an inactive session  after  15
       minutes.   If  the  -t option is specified, the inactivity
       timeout period will be set to timeout seconds.   A  client
       may  also  request a different timeout period; the maximum
       period allowed may be set to timeout seconds with  the  -T
       option.  The default limit is 2 hours.

You may be using a different ftpd, but overall, it might be similar. You just might be hitting the default max timout limit.

Try running a loop to send ten or twenty files at a time to see if it still times out
# 3  
Old 08-20-2007
Hi blowtorch,
I am using the following line in my script.
ftp -ivT -n $HOST_NAME << ENDSCRIPT >> $LOGFILE

When i used it it gave me"invalid option -T"

Trying in a loop will be quite complicated as per as the filenaming conventions and other things are concerned. If you could please suggest me the way to improve performance i will be grateful to you.
# 4  
Old 08-20-2007
Few things : how big are these 200 files ? What is the server timeout ? As blowtorch suggested, in his version the default time out is 15 minutes, in my version of ftpd the default is 2 hours. Check the server timeout on the remote side, if you can. Also, turn on the -v -d flags for verbose and debug, eventually later look at the error codes. What are the operating systems involved, which clients and servers are used ?
# 5  
Old 07-02-2009
FTP-Shell Script-Performance issue

Hello All,

Apologies if i come to wrong thread.
Request any one of Unix/Linux masters to clarify on the below.

How far it is feasible to open a new ftp connection for transferring each file when there are multiple files to be sent. I have developed shell script to send all files at single stretch but some how it doesnt suit to the requirement as well. I was asked to do each file transfer differently i.e one file per one ftp.

will it effect the performance of the system? Please throw some light on this.

Thanks,
RSC1985
# 6  
Old 07-03-2009
The answer depend on the case. What's the files size ? In most of the cases spawning more FTP client instances will affect the performance, but if you have, let's say 10 files X 5 MB, it's more wiser to fire the transfers simultaneously, thus using the capabilities of the available TCP resources. Otherwise, you'll be sending all those 10 files sequentially, and the total time for transfers will be ~10 times slower. But once again, you need to go more into details, before we can recommend one approach over other.
# 7  
Old 07-03-2009
For my experience, i am using Net::FTP, for more than 100 files in remote machine, size from 5m to 80m, and file transfered in fork, did not find any problem so far.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Performance Issue - Shell Script

Hi, I am beginner in shell scripting. I have written a script to parse file(s) having large number of lines each having multiple comma separated strings. But it seems like script is very slow. It took more than 30mins to parse a file with size 120MB (523564 lines), below is the script code ... (4 Replies)
Discussion started by: imrandec85
4 Replies

2. Shell Programming and Scripting

Performance issue in shell script

Hi All, I am facing performance issue while rinning the LINUX shell script. I have file1 and file 2. File one is the source file and file 2 is lookup file. Need to replace if the pattern is matching in file1 with file2. The order of lookup file is important as if any match then exit... (8 Replies)
Discussion started by: ureddy
8 Replies

3. UNIX for Dummies Questions & Answers

awk script performance issue

Hello All, I have the below excerpt of code in my shell script and it taking long time to complete, though it prints the output quickly. Is there a way to make it come out once it finds the first instance as the file size of 4.7 GB it could be going through all lines of the data file to find for... (3 Replies)
Discussion started by: Ariean
3 Replies

4. Shell Programming and Scripting

FTP command issue in shell script

Hi All I am using following code in my shell script to send the file to a mainframe server. ftp -in $FTP_IP_SEND <<END_OF_FTP >$LOG_DIR/ProviderExportFTP.log quote user $FTP_USER_SEND quote pass $FTP_PASS_SEND ascii send ./ProviderExport.txt 'PROJ.PDRCACTS.FD87050.EXPORT' (REPLACE... (3 Replies)
Discussion started by: Renjith180282
3 Replies

5. Shell Programming and Scripting

FTP script variable issue

Hi , I have a following code ,I need to send two files on FTP server using single code UDL_FTIHOST_1=podftiapp02.com UDL_FTIUSER_1=dbsunny UDL_FTIPWD_1=sunny@11 UDL_FTIHOST_2=podftiapp01.com UDL_FTIUSER_2=dbamy UDL_FTIPWD_2=amy@12 count=2 i=1 while do FTIHOST=$(echo... (3 Replies)
Discussion started by: sonu_pal
3 Replies

6. Shell Programming and Scripting

Script performance issue

hi i have written a shell script which comapare a text file data with files within number of different directories. example. Text File: i have a file /u02/abc.txt which have almost 20000 file names Directories: i have a path /u03 which have some subdirectories like a,b,c which have almost... (2 Replies)
Discussion started by: malikshahid85
2 Replies

7. UNIX for Advanced & Expert Users

FTP-Shell Script-Performance issue

Hello All, Request any one of Unix/Linux masters to clarify on the below. How far it is feasible to open a new ftp connection for transferring each file when there are multiple files to be sent. I have developed shell script to send all files at single stretch but some how it doesnt suit to... (3 Replies)
Discussion started by: RSC1985
3 Replies

8. Shell Programming and Scripting

Performance issue with awk script.

Hi, The below awk script is taking about 1 hour to fetch just 11 records(columns). There are about 48000 records. The script file name is take_first_uniq.sh #!/bin/ksh if then while read line do first=`echo $line | awk -F"|" '{print $1$2$3}'` while read line2 do... (4 Replies)
Discussion started by: RRVARMA
4 Replies

9. Shell Programming and Scripting

please help ftp script issue

hi, I have ftp script where the user name has "\" in it and my script unable to detect it....here is what I am doing... `ftp -vin <<- FTP >> log.txt 2>&1 user ibm\user password FTP` my log says.. user ibmuser not found... please help..... (4 Replies)
Discussion started by: mgirinath
4 Replies

10. UNIX for Advanced & Expert Users

Unix Shell script FTP Issue

Hi All We have a number of FTP Shell scripts running every day on a scheduled basis. The issue we have is if the host connection is not available after a little while ftp times out and the script hangs as the shell returns to the ftp> prompt waiting for input from a user. Any ideas how... (2 Replies)
Discussion started by: mlucas
2 Replies
Login or Register to Ask a Question