[Pacemaker] A question and demand to a resource placement strategy function

Vladislav Bogdanov bubble at hoster-ok.com
Wed Aug 24 05:38:18 EDT 2011

23.08.2011 12:19, Gao,Yan wrote:
> When allocating every resource, we compare the capacity of the nodes.
> The node has more remaining capacity is preferred. This would be quite
> clear if we only define one kind of "capacity". While if we define
> multiple kinds of "capacity", for example:
> If nodeA has more cpus remaining, while nodeB has more ram and storage
> remaining -- nodeB has more capacity.

Thanks a lot for clarifying this.
So, each remaining capacity parameter values are compared between nodes,
and each node gets "1" pseudo-score if it has more capacity, and "0"
otherwise. Then that pseudo-scores are summed and that sums are
compared. Nodes with greater sum win.

Did I understand you correctly?

> If nodeA has more cpus and storage1 remaining, nodeB has more ram and
> storage2 remaining -- They have the equal capacity. Then the first
> listed node is preferred.

Wouldn't it be better from the load-balancing point of view to use
round-robin placement instead of just picking first listed node?

>> Also could you please describe algorithm used for placement in little
>> bit more details, so I would ask less stupid questions. Does it have
>> something related to linear programming (f.e.
>> http://en.wikipedia.org/wiki/Simplex_method)?
> An optimal solution definitely requires some mathematical optimization
> method. Though we don't use one so far. It's somewhat complicated to be
> introduced and combined with the current allocation factors.

Thank you for information. Do you have any plans implementing this? I
did some linear optimization works when studied at university long ago,
and it wasn't too complicated to actually code the algorithm. Although
it was very hard to understand what exactly all that methods do and how
to apply them to a real-life task.

> The policy for choosing a preferred node is just like above.
> The order for choosing resources to allocate is:
> 1. The resource with higher priority gets allocated first.
> 2. If their priorities are equal, check if they are already running. The
> resource has higher score on the node where it's running gets allocated
> first. (-- which was recently improved by the work of Andrew and Yuusuke
> to prevent resource shuffling.)
> 3. The resource has higher score on the preferred node gets allocated first.
> Regards,
>   Gaoyan

Thank you,

More information about the Pacemaker mailing list