The allocator is currently only pluggable insomuch as it is a C++ class, and one could subclass/replace it with a custom implementation and then recompile Mesos. The default/only allocator implementation is (hierarchical) DRF, which will only offer a resource to a single framework at a time.
True pluggable allocator modules (MESOS-2160 <https://issues.apache.org/jira/browse/MESOS-2160>) are landing in Mesos 0.23, so you can't use them in a stable release yet. Optimistic Offers (MESOS-1607 <https://issues.apache.org/jira/browse/MESOS-1607>) is currently in-progress, but won't land until at least Mesos 0.24. As for advantages over a single monolithic scheduler, there are a few: - Fair scheduling: Mesos compares the current resource allocation for each framework against its (weighted) fair share, and offers newly available resources to the role/framework that is furthest below its fair share. - Two-level scheduling: Mesos only chooses which framework to offer resources to, and then the framework decides which of its tasks to launch using those offered resources. This means that a complex scheduler could contemplate offers for seconds/minutes to make an optimal placement decision, or a low-latency scheduler could just launch tasks on the first-available resources. The Mesos scheduling decision is very simple/fast, leaving the rest up to the frameworks for maximum flexibility/scalability. This also means that the complex scheduler will not impact the scheduling latency of other lower-latency schedulers. On Mon, Jun 8, 2015 at 8:31 AM, Michael Hausenblas < [email protected]> wrote: > > > So Mesos can support both 1 and 2 which actually depends on which > allocator being used, right? > > I might be wrong and happy if someone wants to correct me but while the > allocator module is per design pluggable* the (one and only) current > implementation is the DRF. > > So, can Mesos support 1 and 2? Yes, as I pointed out one way ahead is > https://issues.apache.org/jira/browse/MESOS-1607 > > How does Mesos behave per default, ATM? IMHO it is 1. > > > *) http://mesos.apache.org/documentation/latest/allocation-module/ > > Cheers, > Michael > > -- > Michael Hausenblas > Ireland, Europe > http://mhausenblas.info/ > > > On 8 Jun 2015, at 17:01, Qian Zhang <[email protected]> wrote: > > > > Hi Michael, > > > > I think it may not be the latter becauseI see this in the comments of > the function resourceOffers(): > > * Note that resources may be concurrently offered to more than one > > * framework at a time (depending on the allocator being used). In > > * that case, the first framework to launch tasks using those > > * resources will be able to use them while the other frameworks > > * will have those resources rescinded (or if a framework has > > * already launched tasks with those resources then those tasks will > > * fail with a TASK_LOST status and a message saying as much). > > */ > > > > So Mesos can support both 1 and 2 which actually depends on which > allocator being used, right? > > > > > > 2015-06-06 19:06 GMT+08:00 Michael Hausenblas < > [email protected]>: > > > > > 1. Mesos master offers all the resources to all the frameworks > simultaneously. > > > 2. Mesos master offers resources to one framework at a time, e.g., it > offers r1, r2, r3 to f1, and f1 accepts r1, and then it offers r2 and r3 to > f2, ... > > > > The latter, yes. > > > > For a quick overview, I suggest you have a look at > http://mesos.apache.org/documentation/latest/mesos-architecture/ which > covers the resource offer cycle. > > > > If you want to dive deeper, you might want to read: > > > > 1. http://mesos.berkeley.edu/mesos_tech_report.pdf > > 2. https://www.cs.berkeley.edu/~alig/papers/drf.pdf > > > > > > Note that there's a feature in the works that would be closer to your > 1., see https://issues.apache.org/jira/browse/MESOS-1607 > > > > Cheers, > > Michael > > > > -- > > Michael Hausenblas > > Ireland, Europe > > http://mhausenblas.info/ > > > > > On 6 Jun 2015, at 12:51, Qian Zhang <[email protected]> wrote: > > > > > > Hi, > > > > > > I am new to Mesos, and I'd like to know if there are a lot resources > in the Mesos cluster, how will Mesos master offer these resources to the > multiple frameworks? I guess there can be two ways: > > > 1. Mesos master offers all the resources to all the frameworks > simultaneously. > > > 2. Mesos master offers resources to one framework at a time, e.g., it > offers r1, r2, r3 to f1, and f1 accepts r1, and then it offers r2 and r3 to > f2, ... > > > > > > If it is 1, then I'd like to know how Mesos master resolves the > conflicts, e.g., multiple frameworks accept the same resource. > > > If it is 2, then I see it is actually a serial process since Mesos > master handle the frameworks one by one, then what is advantage of Mesos > against traditional monolithic resource scheduler? > > > > > > > > > Thanks, > > > Qian > > > > > >

