Re: split the load?

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Robert Black
日付:  
To: exim-users
題目: Re: split the load?
Careful with that quoting. You snipped all the bits I actually wrote. I suspect
that the answer to your question is that random() is one of those fun functions
which always causes porting problems because for some reason there are about 6
different standards to choose from.

Cheers

Rob

On Nov 22, 8:24am, Neal Becker wrote:
> Subject: Re: split the load?
> >>>>> "Robert" == Robert Black <r.black@???> writes:
>
>     >> At the relevant time, Exim is scanning the list of RRs returned by the
>     >> nameserver, and inserting them into a list in order of their MX

values.
>     >> The current rule is "insert before the entry with a higher MX value".
>     >> It would have to be changed by the addition of an extra rule such as
>     >> "If there are a group of entries with the same MX value, choose at
>     >> random where to insert." If there are n such entries, then there are

n+1
>     >> possible places to insert. What is the best *cheap* way of getting a
>     >> random number between 0 and n? Is something like "take the last m bits
>     >> of the time of day modulo (n+1)" good enough for this purpose?

>
> I would just generate a random integer (using random(), for example),
> then if there are n slots just do:
>
> int i = random() % n;
>
> Why make this complicated?
>
>-- End of excerpt from Neal Becker




--