Hello All,
This is what I am trying to do but gave up
I want the user to be able to click on a button or a trigger on http://domainA.com
then DomainA web server would go and download a file (specified file) from http://domainB.com/file.zip
then it will measure the speed of the download (from DomainB to DomainA) and finally report it to the the user.
I have tried fput but got stock there.... I am a little new to these functions as to measuring speed.
I do not want to get the download from DomainA to the user, I want to make it from DomainB to DomainA (servers) as if the user is on dial up then that should be independant.
I greatly appeciate all your help.
Remote File download and measure speed
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
if you want to "simulate" the download as a modem user, you don't need to transfer the file at all. Simply using the optimistic rate for a modem user (53kbps in the US) as a multiplier based on the file size, which DomainB can report far faster and more easily.
given a file of exactly 1MB (1,048,576 bytes), at optimum performance someone can expect the download to take just a bit over 2.5 minutes.
The math:
1,048,576 bytes of transfer * 8 bits per byte / (53 * 1024) actual bit rate = 154.56603773584905660377358490566 seconds
Due to various network latency and traffic issues, very very very very few people will ever see the optimistic rate, so you can add a percentage fudge factor onto the result as well to help compensate for that. Unfortunately, transferring the data between the two servers may not be realistic in the user's perspective because
given a file of exactly 1MB (1,048,576 bytes), at optimum performance someone can expect the download to take just a bit over 2.5 minutes.
The math:
1,048,576 bytes of transfer * 8 bits per byte / (53 * 1024) actual bit rate = 154.56603773584905660377358490566 seconds
Due to various network latency and traffic issues, very very very very few people will ever see the optimistic rate, so you can add a percentage fudge factor onto the result as well to help compensate for that. Unfortunately, transferring the data between the two servers may not be realistic in the user's perspective because
- the time taken between the two servers will only help you understand the latency between the two servers, not between the user and the server.
- transferring the files will eat a lot of bandwidth for, as far as I can see, no real benefit.