incubator-ooo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcus (OOo)" <>
Subject Re: [DL LOGIC] How to choose a mirror when more than 1 is available?
Date Sat, 07 Apr 2012 17:38:20 GMT
Am 04/07/2012 05:34 PM, schrieb Rob Weir:
> On Sat, Apr 7, 2012 at 10:13 AM, Marcus (OOo)<>  wrote:
>> For our new release we will have a changed set of conditions:
>> - new central mirror hosts for redirecting download requests
>> - therefore also a new set of mirror server that host our builds
>> - new set of supported platforms and languages
>> - slighty changed file name schema
>> To get this all under one hat, we have to improve the download logic that is
>> currently done by JavaScript.
>> To fulfill the first condition the download requests have to be split-up to
>> more than 1 central mirror redirector.
>> Here is a suggestion for choosing when (by random number) to redirect to
>> which mirror:
>> Test results:
>> - to make debugging easier I've included some screen output and comments
>> - I've tested it locally with different combinations of active/inactive
>>   hosts and it works well
>> - the fallback method works well, too
>> - I've tested different percent values as ratio, but not yet for the
>>   2nd case
>> What do you think?
> The logic on the test pages works for me.
> But two additional complexities:
> 1)  MirrorBrain let's us link directly to a download file.  We then
> send the user to
> while the file is downloading.  But SourceForge and Apache mirror
> systems take the user to a different page (not controlled by us). So
> in those cases the user does not see the contribute.html page.

This should work also for SourceForge. The root path is always the same. 
We just need to add a subdir and file name.

I don't know how to do it for Apache.

> Since the contribute.html page has very useful information for the
> user, like links to the install instructions, information on support,
> contributing to the project, etc., I think it is important that the
> user sees this information in all paths.


> What could we do? Pop-up (or pop-under) a new HTML page?  But that is
> annoying to some users.


> The Apache and SF approaches both direct a user off of the
> website, which is risky.
> 2) What if we have more than three mirror systems?  It sounds like you
> prefer to keep MirrorBrain.  That is fine with me. So maybe we have
> Apache, SF and MirrorBrain?

Yes, would be great. Another available system as possible backup is not bad.

For any change of the number of available systems we have to adapt the 
JS logic.

> Imagine an array of mirror networks, each with weights, in sorted
> order from smallest to largest.  (or sort the array in code)
> Apache:1
> MirrorBrain:2
> SourceForge:3
> TotalWeight =  MirrorBrain + Apache + SourceForge == 6
> x = rand()
> if (x<  Apache/TotalWeight)
>      doApache()
> else if (x<  MirrorBrain/TotalWeight)
>      doMirrorBrain()
> else
>      doSourceForge()
> Something like that.

Redirecting due to weighted values looks good. But also this is working 
with a fixed set of mirror hosts. A forth had to be build in and 
therefore the logic has to be adapted.

Thanks for your feedback. I'll adapt the script later in the evening.


View raw message