mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Meng Zhu <m...@mesosphere.io>
Subject Re: Review Request 68808: Avoided dirtying the DRF sorter when an allocation is performed.
Date Wed, 26 Sep 2018 20:43:12 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68808/#review209041
-----------------------------------------------------------




src/master/allocator/sorter/drf/sorter.cpp
Lines 349-352 (original), 356-391 (patched)
<https://reviews.apache.org/r/68808/#comment293307>

    Ideally, we should just have a clean priority queue and forget any of this. That would
also make this logN.
    
    But it would require changing the `sort()` interface and thus the code in the allocator
as well.



src/master/allocator/sorter/drf/sorter.cpp
Lines 365-369 (patched)
<https://reviews.apache.org/r/68808/#comment293309>

    I think we can just work with iterators. It will be more generic and readable. I will
leave that to you.



src/master/allocator/sorter/drf/sorter.cpp
Lines 349-352 (original), 371-391 (patched)
<https://reviews.apache.org/r/68808/#comment293310>

    How about:
    
    ```
      while (position > 0 &&
             DRFSorter::Node::compareDRF(current, children[position - 1])) {
        std::swap(children[position], children[position - 1]);
        --position;
      }
    
      while (position + 1 < children.size() &&
             children[position + 1]->kind != Node::INACTIVE_LEAF &&
             DRFSorter::Node::compareDRF(children[position + 1], current)) {
        std::swap(children[position], children[position + 1]);
        ++position;
      }
    ```


- Meng Zhu


On Sept. 24, 2018, 7:23 p.m., Benjamin Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68808/
> -----------------------------------------------------------
> 
> (Updated Sept. 24, 2018, 7:23 p.m.)
> 
> 
> Review request for mesos, Gastón Kleiman and Meng Zhu.
> 
> 
> Bugs: MESOS-9249
>     https://issues.apache.org/jira/browse/MESOS-9249
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This improves performance by ensuring that the DRF sorter can remain
> sorted throughout an allocation cycle. Without this change, we spend
> the majority of time re-sorting throughout an allocation cycle, when
> there are large numbers of clients (roles / frameworks).
> 
> Before with --enable-optimize:
> 
> *HierarchicalAllocator_BENCHMARK_Test.DeclineOffers/21
> Added 1000 frameworks in 28.685387ms
> Added 10000 agents in 3.962511243secs
> round 0 allocate() took 3.183115931secs to make 10000 offers ...
> round 1 allocate() took 3.398068093secs to make 10000 offers ...
> round 2 allocate() took 3.314738469secs to make 10000 offers ...
> 
> After with --enable-optimize:
> 
> *HierarchicalAllocator_BENCHMARK_Test.DeclineOffers/21
> Added 1000 frameworks in 38.145091ms
> Added 10000 agents in 1.791872685secs
> round 0 allocate() took 1.193577545secs to make 10000 offers ...
> round 1 allocate() took 1.288540671secs to make 10000 offers ...
> round 2 allocate() took 1.169376468secs to make 10000 offers ...
> 
> 
> Diffs
> -----
> 
>   src/master/allocator/sorter/drf/sorter.cpp a45f66ff0d77becb6f96f7ff4c288e4ab218e070

> 
> 
> Diff: https://reviews.apache.org/r/68808/diff/1/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Benjamin Mahler
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message