FTP delays

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
MacIvar
Posts: 4
Joined: Wed Apr 20, 2011 7:25 pm

FTP delays

Post by MacIvar »

Has anyone (using 4.6) experienced 60 second delays when using the URL keyword in this form:

Code: Select all

put URL "ftp://user:password@ip.address/directory/filename" into varName
I have several Macs running older versions of Revolution and performing literally thousands of FTP downloads a day, usually a few tens of bytes per download, and they take 100 milliseconds or less. I have introduced a new Intel Mac running LiveCode 4.6 into the mix, and most of the time it can FTP in under 100 msecs, but it can also take 60100 millisecs on occasion. There is no rhyme or reason to when this delay shows up, from what I can see, but it always appears to be around 60 seconds. Sometimes it happens twice a day, sometimes it happens ten times an hour. The FTP server can be either another Mac or a local network storage appliance.

Any thoughts? Thanks, Ivar
Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: FTP delays

Post by Mark »

Hi MacIvar,

I vaguely remember an update related to this issue. Have you tested 4.6.1?

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
MacIvar
Posts: 4
Joined: Wed Apr 20, 2011 7:25 pm

Re: FTP delays

Post by MacIvar »

Mark,

Haven't tried 4.6.1 but I certainly will, thanks!

-Ivar
akeyalee
Posts: 1
Joined: Fri May 20, 2011 6:53 am

Re: FTP delays

Post by akeyalee »

Why is it faster to download a file through FTP vs Terminal Services? A 5 GB file seems to be a lot faster download as compared to using remote desktop to copy the remote file to my local drive. I know FTP is built for file transfering, but what exactly makes it so much faster?
___________________________
market samurai ~ marketsamurai
Last edited by akeyalee on Wed May 25, 2011 8:51 am, edited 1 time in total.
MacIvar
Posts: 4
Joined: Wed Apr 20, 2011 7:25 pm

Re: FTP delays

Post by MacIvar »

Two weeks after switching to 4.6.1 here are some results taken from the two Macs that do the most FTP'ing around here...

The rate of 60 second delays experienced during FTP, expressed as number of delays per 1000 transfers, are -
using 4.6 : 3.048
using 4.6.1: 3.905

In other words, it got worse. Not to say that the upgrade is the cause, something else in the network environment may have changed, but if there was a specific fix to address this problem in 4.6.1 it didn't work for me.

<sigh>
BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: FTP delays

Post by BvG »

Most likely this is a DNS problem, or a problem with the way LiveCode handles DNS. The approach was changed with 4.6, so it might be worthwhile to check if the same problem exists in an older version.

As for fixing, and assuming LC has faulty DNS code somewhere,maybe a mail to support AT runrev dot com could help make them aware of a general issue.

For an immediate workaround, you could try to do the lookup manually, then only using the ip in your ftp calls. The following functions will be helpfull with that:

the dnsServers
the hostAddressToName
the hostNameToAddress

Obviously this won't help if the problem is not in the DNS code, but the libURL ftp calls themselves.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
MacIvar
Posts: 4
Joined: Wed Apr 20, 2011 7:25 pm

Re: FTP delays

Post by MacIvar »

This is valuable insight - my Macs are on an isolated network without a DNS, all IP addressing is done with dotted-quad numbers. I did some quick testing on 4.5.3 and the problem exists there too, with at least the same results if not worse.

I'll send a note off to the support folks. Thanks BvG!

-Ivar
Steve
Posts: 30
Joined: Fri Nov 07, 2008 10:46 pm
Contact:

Re: FTP delays

Post by Steve »

Dear BvG,

I’m also experiencing these delays, and would like to try your suggestion using hostNameToAddress. But I can’t figure out how to do it when my ftp command addresses directories and subdirectories. For example, suppose my original ftp command is:

put URL “ftp://signonname:password@www.address.c ... lename.txt" into StringName

and I use hostNameToAddress to determine that http://www.myaddress.com is 77.777.777.77. What part of my “put” command gets the 77.777.777.77? I tried replacing just the “ww.myaddress.com”, but that does not work.

Sincerely,

Steve Alessi
Steve Alessi
Associate Professor
The University of Iowa
Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: FTP delays

Post by Mark »

Hi Steve,

You use the domain name only:

Code: Select all

put hostnametoaddress("domain.com")
Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Steve
Posts: 30
Joined: Fri Nov 07, 2008 10:46 pm
Contact:

Re: FTP delays

Post by Steve »

Sorry, I did not ask my question clearly enough. I understand how to get the I.P. number using
put hostnametoaddress("domain.com").

My question is, once I have the I.P. number, what does it replace within a command like the following:

put URL “ftp://signonname:password@www.address.c ... lename.txt" into StringName

(Isn't that the reason for getting the actual I.P. number?)

Steve Alessi
Steve Alessi
Associate Professor
The University of Iowa
Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: FTP delays

Post by Mark »

Hi Steve,

OK, I get it. You replace the first part, www.domain.com, with the IP address. You will always need to use the actual path to the directory, i.e. www.domain.com/sub1/sub2/file.php and not sub1.domain.com/sub2. If you have a shared server, this solution may not work at all.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Post Reply