Skip to content

fix distribution of new mailboxes

o@ungehorsam.ch requested to merge distribution into master

empirically verified that this evens out a lot faster than what we had before. The old formula didn't make much sense. Given the current load is:

a: 10, b: 20, c: 20

the old chance of getting picked was:

a: 1-(1/5),  b: 1-(2/5),  c: 1-(2/5)

ie.

a: 0.8, b: 0.6, c: 0.6

normalized (so they sum up to 1.0):

a: 0.4, b: 0.3, c: 0.3

In other words "a" was less likely as "b || c", which is clearly not good... The 1-(percentage) does not make much sense, since the resulting sum does not add up to 1.

The new distribution is to use the asymptotic function (1/percentage)**2 as the relative likelihood.

In the above example it would be:

a: 25, b: 6.25, c: 6.25

normalized:

a: 0.67, b: 0.17, c: 0.17

which converges much faster!

Merge request reports