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

Lisheng Sun commented on HDFS-15409:
------------------------------------

{quote}
So we could do it more tricky for case when clientShortCircuitNum = 3.

Divide by modulo 100 (instead of 10).
If two last digits between 0 and 32 then put it into clientShortCircuitNum[0] 
-> 32% of blocks
If two last digits between 33 and 65 then put it into clientShortCircuitNum[1] 
-> 32% of blocks
If two last digits between 66 and 99 then put it into clientShortCircuitNum[2] 
-> 33% of blocks
Similar logic we can use when clientShortCircuitNum = 4: 

Divide by modulo 100.
If two last digits between 0 and 24 then put it into clientShortCircuitNum[0] 
-> 25% of blocks
If two last digits between 25 and 49 then put it into clientShortCircuitNum[1] 
-> 25% of blocks
If two last digits between 50 and 74 then put it into clientShortCircuitNum[2] 
-> 25% of blocks
If two last digits between 75 and 99 then put it into clientShortCircuitNum[3] 
-> 25% of blocks
{quote}
i think these result don't depend on curent the code and  use new strategy.
 current strategy is  blockid % 10.
so if the clientShortCircuitNum is 3 or 4 and according to the current code, 
what is the result?

>  Optimization Strategy for choosing ShortCircuitCache
> -----------------------------------------------------
>
>                 Key: HDFS-15409
>                 URL: https://issues.apache.org/jira/browse/HDFS-15409
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Lisheng Sun
>            Assignee: Lisheng Sun
>            Priority: Major
>
> When clientShortCircuitNum is 10, the probability of falling into each 
> ShortCircuitCache is the same, while the probability of other 
> clientShortCircuitNum is different.
> For example if clientShortCircuitNum is 3, when a lot of blockids of SSR are 
> ***1, ***4, ***7, this situation will fall into a ShortCircuitCache.
> Since the real environment blockid is completely unpredictable, i think it is 
> need to design a strategy which is allocated to a specific ShortCircuitCache. 
> This should improve performance even more.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to