Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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!

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer
    
Thank your for your reply I was not aware of the current CDN offer, looks like a resource to have into account. –  Juan Aug 9 '11 at 7:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.