hURL questions

Find quick help here to get you started with Hollywood
Post Reply
amyren
Posts: 361
Joined: Thu May 02, 2019 11:53 am

hURL questions

Post by amyren »

At first when using commands like uploadfile and downloadfile I did only use ftp or http so I had no need for hURL. Later I added support for ftps and https protocols by using hURL

I implemented a check to determine if hURL was needed or not, and then only use hURL when ftps or https was detected.
Those parts wouldl look something like this

Code: Select all

If FindStr(server_ul_config$, "tps:") > 0 And FindStr(server_ul_config$, "tps:") < 3 Then hurlreqU = True

If hurlreqU
	UploadFile(serverlogfile$, {File = filsti$, Adapter = "hurl"})
Else
	UploadFile(serverlogfile$, {File = filsti$})
EndIf
But I guess that I could simplify my code a bit by just hURL in any case, since hURL should work with both ftp/http and ftps/https.
Are there any disadvantages by using hURL when strickly not needed, like would it be slower or more resource demanding?
(given that I am loading the hURL plugin in any case at the start of the script)

Now, next question.
Sometimes I have experienced timeout errors during network operations. (May happen regardless if hURL is in use or not)
Last time it was during Uploadfile, without using hURL.
hURL have some options for setting the timeouts, and I read that some of the default timouts are as high as 300 seconds. Will these values apply when using the hURL adapter? And what are the default timeout for Uploadfile when not using hURL?
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: hURL questions

Post by airsoftsoftwair »

amyren wrote: Sat Oct 28, 2023 1:34 pm But I guess that I could simplify my code a bit by just hURL in any case, since hURL should work with both ftp/http and ftps/https.
Are there any disadvantages by using hURL when strickly not needed, like would it be slower or more resource demanding?
You have to try ;) On systems like Windows or Linux it could also be faster because hURL (which uses cURL) might use multi-threaded downloading on those platforms. On AmigaOS it might be slower. But this is all speculation... why not do some benchmarks and post them here? :)
amyren wrote: Sat Oct 28, 2023 1:34 pm and I read that some of the default timouts are as high as 300 seconds.
Where?
amyren wrote: Sat Oct 28, 2023 1:34 pm Will these values apply when using the hURL adapter? And what are the default timeout for Uploadfile when not using hURL?
By default those commands should use the default timeout set using SetNetworkTimeout() which defaults to 10 seconds or something.
amyren
Posts: 361
Joined: Thu May 02, 2019 11:53 am

Re: hURL questions

Post by amyren »

airsoftsoftwair wrote: Sun Oct 29, 2023 5:13 pm
amyren wrote: Sat Oct 28, 2023 1:34 pm and I read that some of the default timouts are as high as 300 seconds.
Where?


By default those commands should use the default timeout set using SetNetworkTimeout() which defaults to 10 seconds or something.
In the hURL manual section 5.93 and 5.94 there is mentioned a 300 second default timeout

SetNetworkTimeout() will apply for any network operation, like OpenConnection, UploadFile and DownloadFile?
amyren
Posts: 361
Joined: Thu May 02, 2019 11:53 am

Re: hURL questions

Post by amyren »

I did some tests here uploading and downloading via my hostinger ftp account on Windows 11.

In general hURL is slower in both upload and download when dealing with smaller files.
(expect for one of the benchmarks for the 1.36MB downloads, where I think there must have been a network issue during that test)

When transfering the 9MB file it starts to look better for hURL. Still a bit slower for uploads, but for downloads hURL is much faster.

For the 120MB file upload speed is almost even, and for downloads hURL is nearly twice as fast.

I did try to do a test with http download, but those results was not to be trusted. Probably there are som proxy server in my current network that messes up. First time is like normal duration, but if I repeat with the same file it goes in no time.

Code: Select all

24 byte text file

Uploaded 100 files using hURL in 74023ms
Uploaded 100 files in 62820ms
Downloaded 100 files using hURL in 75872ms
Downloaded 100 files in 65524ms

Uploaded 1000 files using hURL in 70864ms
Uploaded 1000 files in 62604ms
Downloaded 1000 files using hURL in 76847ms
Downloaded 100 files in 66280ms


136kB text file

Uploaded 100 files using hURL in 90651ms
Uploaded 100 files in 76696ms
Downloaded 100 files using hURL in 118153ms
Downloaded 100 files in 106526ms

Uploaded 100 files using hURL in 85865ms
Uploaded 100 files in 77337ms
Downloaded 100 files using hURL in 115188ms
Downloaded 10 files in 103986ms


1,36MB image file
Uploaded 100 files using hURL in 164822ms
Uploaded 100 files in 105827ms
Downloaded 100 files using hURL in 239034ms
Downloaded 100 files in 144529ms

Uploaded 100 files using hURL in 166234ms
Uploaded 100 files in 103865ms
Downloaded 100 files using hURL in 163159ms
Downloaded 100 files in 551854ms

Uploaded 10 files using hURL in 16596ms
Uploaded 10 files in 20723ms
Downloaded 10 files using hURL in 14637ms
Downloaded 10 files in 55163ms

Uploaded 10 files using hURL in 16469ms
Uploaded 10 files in 10534ms
Downloaded 10 files using hURL in 14061ms
Downloaded 10 files in 13922ms

Uploaded 10 files using hURL in 16160ms
Uploaded 10 files in 11012ms
Downloaded 10 files using hURL in 13938ms
Downloaded 10 files in 13820ms

9MB pdf file
Uploaded 100 files using hURL in 416057ms
Uploaded 100 files in 327034ms
Downloaded 100 files using hURL in 319241ms
Downloaded 100 files in 523652ms

Uploaded 100 files using hURL in 418601ms
Uploaded 100 files in 321962ms
Downloaded 100 files using hURL in 317163ms
Downloaded 100 files in 525449ms

120MB zip file
Uploaded 2 files using hURL in 64316ms
Uploaded 2 files in 62432ms
Downloaded 2 files using hURL in 68681ms
Downloaded 2 files in 121605ms

Uploaded 2 files using hURL in 63960ms
Uploaded 2 files in 61816ms
Downloaded 2 files using hURL in 69439ms
Downloaded 2 files in 118019ms
Post Reply