Mobile app version of vmapp.org
Login or Join
Gonzalez347

: Choose from client best server to download from My web site has a download of a file of about 10Mb. I can have it stored in more than one server and was thinking of a way to offer the

@Gonzalez347

Posted in: #Ajax #Download #Performance

My web site has a download of a file of about 10Mb. I can have it stored in more than one server and was thinking of a way to offer the download to the best performing server (performance measured from the client's side, testing from the own server could lead to unreliable results as the download could go though different paths)

Do you think this is realistic? I have no experience with Ajax but by what I've seen a path could be creating an XMLHttpRequest object and do some request to the server asynchronously, on receipt of a response I could update the actual download address (having a default one for the case there's no response when the user starts the download). Do you tink it's that a good idea? (and for the case I am inventing the wheel please let me know where is one ready :-)

Thanks!

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Gonzalez347

1 Comments

Sorted by latest first Latest Oldest Best

 

@Nickens628

You could use an existing content delivery network, such as Amazon Cloudfront, which automatically serves the file from the nearest server to the person requesting it. (The nearest server will very often be the fastest one.)

You could alternatively use a load balancing service, such as cloud load balancers from Rackspace, to determine which of your download servers were under less load to serve the file from there.

If you wanted to test which server was faster from the user's machine, you could fetch a small series of images of the same size from each server, and time how long it took until the images were loaded, then use the server with the lowest response time. The episodes.js JavaScript library may help with this.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme