[ 
https://issues.apache.org/jira/browse/HIVE-21686?focusedWorklogId=241298&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-241298
 ]

ASF GitHub Bot logged work on HIVE-21686:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/May/19 20:46
            Start Date: 13/May/19 20:46
    Worklog Time Spent: 10m 
      Work Description: odraese commented on pull request #626: [HIVE-21686] 
ensure that memory allocator does not evict using brute …
URL: https://github.com/apache/hive/pull/626#discussion_r283427024
 
 

 ##########
 File path: 
llap-server/src/java/org/apache/hadoop/hive/llap/cache/BuddyAllocator.java
 ##########
 @@ -48,6 +48,24 @@
 import org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheMetrics;
 import org.apache.hadoop.hive.ql.io.orc.encoded.StoppableAllocator;
 
+/**
+ *
+ * High level description, functionality and the memory layout.
+ * Allocation can be of general size but it will be rounded to the next power 
of 2.
+ * Allocation smaller than size {@link ConfVars#LLAP_ALLOCATOR_MIN_ALLOC} will 
be rounded to min allocation size.
+ * Allocation bigger than size {@link ConfVars#LLAP_ALLOCATOR_MAX_ALLOC} will 
throw exceptions.
+ * Allocator slices memory slab called {@code arenas} to carve out byte 
buffers using slice and position.
+ *
+ * Each {@code arena} has array of {@code freeList} used for concurrency 
management and to index free buffers by size.
+ * |
+ * Each {@code arena} has a max Size {@link BuddyAllocator#MAX_ARENA_SIZE} 1GB.
+ * \_
+ *   Each arena is divided into chunks of max allocation size {@link 
ConfVars#LLAP_ALLOCATOR_MAX_ALLOC} default 16MB
+ *   \_
+ *     Each chunk of {@code maxAllocationSize} is sliced using the classical 
Buddy Allocator algorithm.
+ *     \_
+ *       Each Buddy Allocator tree can be split up to chunk of size {@link 
ConfVars#LLAP_ALLOCATOR_MIN_ALLOC} 4KB
 
 Review comment:
   chunk -> chunks
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 241298)
    Time Spent: 2.5h  (was: 2h 20m)

> Brute Force eviction can lead to a random uncontrolled eviction pattern.
> ------------------------------------------------------------------------
>
>                 Key: HIVE-21686
>                 URL: https://issues.apache.org/jira/browse/HIVE-21686
>             Project: Hive
>          Issue Type: Bug
>            Reporter: slim bouguerra
>            Assignee: slim bouguerra
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: Cache_hitrate_improvement.csv, HIVE-21686.2.patch, 
> HIVE-21686.patch
>
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> Current logic used by brute force eviction can lead to a perpetual random 
> eviction pattern.
> For instance if the cache build a small pocket of free memory where the total 
> size is greater than incoming allocation request, the allocator will randomly 
> evict block that fits a particular size.
> This can happen over and over therefore all the eviction will be random.
> In Addition this random eviction will lead a leak in the linked list 
> maintained by the policy since it does not know anymore about what is evicted 
> and what not.
> The improvement of this patch is very substantial  to TPC-DS benchmark. I 
> have tested it with 10TB scale 9 llap nodes and 32GB cache size per node.  
> The patch has showed very noticeable difference in the Hit rate for raw 
> number  [^Cache_hitrate_improvement.csv] 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to