理论
Max-Min Fairness (MMF) 是一种在兼顾公平的前提下,尽可能让更多人满意的资源分配算法。
但它并不是一个无懈可击的终极资源分配算法,看它的一个缺点:
On the other hand, max-min fairness provides lower average throughput than maximum throughput resource management, where the least expensive flows are assigned all capacity they can use, and no capacity might remain for the most expensive flows. In a wireless network, an expensive user is typically a mobile station at far distance from the base station, exposed to high signal attenuation. However, a maximum throughput policy would result in starvation of expensive flows, and may result in fewer “happy customers”.
FROM: https://en.wikipedia.org/wiki/Max-min_fairness
可见,MMF 这种让大多数人 happy 的策略 无法让系统吞吐量最大化。这也很好理解,最消耗带宽资源的用户无法及时得到资源,当然不利于最大化吞吐量。
Max-min fairness is said to be achieved by an allocation if and only if the allocation is feasible and an attempt to increase the allocation of any flow necessarily results in the decrease in the allocation of some other flow with an equal or smaller allocation. A max-min fair allocation is achieved when bandwidth is allocated equally and in infinitesimal increments to all flows until one is satisfied, then amongst the remainder of the flows and so on until all flows are satisfied or the bandwidth is exhausted.
FROM https://en.wikipedia.org/wiki/Fairness_measure
通过例子理解MMF 算法
理解不带权值的MMF算法,最直观的方式是想象有几个高矮不同的杯子,从左到右挨个逐轮往里面滴水:
v
4 号杯子最先满,然后是 1 号, 3 号,最后是 2 号。
MMF算法考虑得比上述做法更周全一些。上面四个杯子没有从矮到高排序。 考虑到可能中途没水了,为了让更多人 Happy,可以从矮到高排序,这样就算中途没水了,矮个杯也更有可能被灌满。
v
最极端的,考虑只有一滴水的情况。如果不排序,没有一个杯子会被装满,大家都不满意。如果排序,4号杯子能被装满,至少有一个人满意。
v
下面考虑有 4 滴水的情况,滴完后,4、1、3、2 杯中各有 1 滴水。4 很满意,其余不太满意。那么,能不能给 4 一滴水, 1 三滴水,其余不滴水呢?这样 4 和 1 都很满意,但 3 和 2 非常不满意,并且会高喊不公平。
公平做法:
不公平做法:
v
v
v v
+ +
+ + | |
+ + | | | |
| | | | | |
+ + | | | | | |
+---+ +---+ +---+ +---+
4 1 3 2
Rnd-1 Rnd-2 Rnd-3 Rnd-4
由此可见, MMF 算法是在兼顾公平的前提下尽可能让更多人满意的算法。
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net