[ 
https://issues.apache.org/jira/browse/MESOS-3112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14635182#comment-14635182
 ] 

Jan Schlicht commented on MESOS-3112:
-------------------------------------

The approach is to store the last access time in FetcherProcess::Cache::Entry 
instances. Every time a cache entry is accessed, this value will be set to 
Clock::now().
FetcherProcess::Cache::selectVictims(const Bytes& requiredSpace) can then 
implement a MRU-retention by creating a sorted list (a std::set which a custom 
Compare functor) of all cache entries and select the LRUs by traversing this 
list until requiredSpace could be freed.

> Fetcher should perform cache eviction based on cache file usage patterns.
> -------------------------------------------------------------------------
>
>                 Key: MESOS-3112
>                 URL: https://issues.apache.org/jira/browse/MESOS-3112
>             Project: Mesos
>          Issue Type: Improvement
>          Components: fetcher
>            Reporter: Bernd Mathiske
>            Assignee: Jan Schlicht
>              Labels: mesosphere, performance
>
> Currently, the fetcher uses a trivial strategy to select eviction victims: it 
> picks the first cache file it finds in linear iteration. This means that 
> potentially a file that has just been used gets evicted the next moment. This 
> performance loss can be avoided by even the simplest enhancement of the 
> selection procedure.
> Proposed approach: determine an effective yet relatively uncomplex and quick 
> algorithm and implement it in `FetcherProcess::Cache::selectVictims(const 
> Bytes& requiredSpace)`. Suggestion: approximate MRU-retention somehow.
> Unit-test what actually happens!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to