[
https://issues.apache.org/jira/browse/MESOS-4666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15147748#comment-15147748
]
Anindya Sinha edited comment on MESOS-4666 at 2/15/16 8:01 PM:
---------------------------------------------------------------
Alternate proposal: Although indirectly it might look to be the same, would
instead of total_resources as an actual value within Offer, exposing a
%availability a better option? Say instead of total_resources inside Offer, we
add Labels to Offer, and have something like this in Offer: {noformat} optional
Labels labels = 10;{noformat}
In every offer, we populate labels as follows:
For every resource name, it contains the fraction of what is being offered (in
Offer::resources) to what the total resources are on that slave (which is based
on role of the framework and role of reserved resources).
eg. slave registers as {noformat}cpus(*): 8;mem(*): 8192; disk(*):
8192{noformat}
a] If no tasks are scheduled on this slave, and nothing is reserved on this
slave, then the Offer to a framework registered with the `*` role contains:
{noformat}
Offer::resources = cpus(*): 8;mem(*): 8192; disk(*): 8192
Offer::labels = cpus:1.0;mem:1.0;disk:1.0
{noformat}
b] If this slave has already used up 2 cpus, 4096 mem and 2048 disk either to
tasks or reservation to other roles, then:
{noformat}
Offer::resources = cpus(*): 6;mem(*): 4096; disk(*): 6144
Offer::labels = cpus:0.75;mem:0.5;disk:0.75
{noformat}
c] In addition if this slave has reserved 1 cpu, 1024 mem and 1024 disk to
role1 (but not being used by any task yet), then an Offer to a framework
registered with `role1` shall be something like:
{noformat}
Offer::resources = cpus(*): 5;cpus(role1): 1;mem(*): 3072; mem(role1): 1024;
disk(*): 5120; disk(role1): 1024
Offer::labels = cpus:0.75;mem:0.5;disk:0.75
{noformat}
but an Offer to a framework registered as `*` will be:
{noformat}
Offer::resources = cpus(*): 5;mem(*): 3072; disk(*): 5120
Offer::labels = cpus:0.625;mem:0.375;disk:0.625
{noformat}
was (Author: anindya.sinha):
Alternate proposal: Although indirectly it might look to be the same, would
instead of total_resources as an actual value within Offer, exposing a
%availability a better option? Say instead of total_resources inside Offer, we
add Labels to Offer, and have something like this in Offer: {noformat} optional
Labels labels = 10;{noformat}
In every offer, we populate labels as follows:
For every resource name, it contains the fraction of what is being offered (in
Offer::resources) to what the total resources are on that slave (which is based
on role of the framework and role of reserved resources).
eg. slave registers as cpus(*): 8;mem(*): 8192; disk(*): 8192
a] If no tasks are scheduled on this slave, and nothing is reserved on this
slave, then the Offer to a framework registered with the `*` role contains:
{noformat}
Offer::resources = cpus(*): 8;mem(*): 8192; disk(*): 8192
Offer::labels = cpus:1.0;mem:1.0;disk:1.0
{noformat}
b] If this slave has already used up 2 cpus, 4096 mem and 2048 disk either to
tasks or reservation to other roles, then:
{noformat}
Offer::resources = cpus(*): 6;mem(*): 4096; disk(*): 6144
Offer::labels = cpus:0.75;mem:0.5;disk:0.75
{noformat}
c] In addition if this slave has reserved 1 cpu, 1024 mem and 1024 disk to
role1 (but not being used by any task yet), then an Offer to a framework
registered with `role1` shall be something like:
{noformat}
Offer::resources = cpus(*): 5;cpus(role1): 1;mem(*): 3072; mem(role1): 1024;
disk(*): 5120; disk(role1): 1024
Offer::labels = cpus:0.75;mem:0.5;disk:0.75
{noformat}
but an Offer to a framework registered as `*` will be:
{noformat}
Offer::resources = cpus(*): 5;mem(*): 3072; disk(*): 5120
Offer::labels = cpus:0.625;mem:0.375;disk:0.625
{noformat}
> Expose total resources of a slave in offer for scheduling decisions
> -------------------------------------------------------------------
>
> Key: MESOS-4666
> URL: https://issues.apache.org/jira/browse/MESOS-4666
> Project: Mesos
> Issue Type: Improvement
> Components: general
> Affects Versions: 0.25.0
> Reporter: Anindya Sinha
> Assignee: Anindya Sinha
> Priority: Minor
>
> To effectively schedule certain class of tasks, the scheduler might need to
> know not only the available resources (as exposed currently) but also the
> maximum resources available on that slave. This is specifically true for
> clusters having different configurations of the slave nodes in terms of
> resources such as cpu, memory, disk, etc.
> Certain class of tasks might have a need to be scheduled on the same slave
> (esp needing shared persistent volumes, MESOS-3421). Instead of dedicating a
> slave to a framework, the framework can make a very good determination if it
> had exposure to both available as well as total resources.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)