[
https://issues.apache.org/jira/browse/HADOOP-11152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14152850#comment-14152850
]
Yi Liu commented on HADOOP-11152:
---------------------------------
I have made a brief offline test of blocks distribution using
{{java.util.Random}} and {{java.security.SecureRandom}}. (For result 1#,
similar with Jeff)
The nodes number is 500, and total blocks number are 12000 and 1200000, I get:
* if the total blocks number is small and few blocks for each datanode (i.e.
average 24), then the blocks distribution is not good (range of 9 ~ 35).
* But if total blocks number is large and thousands of blocks for each datanode
(i.e. average 2400), then the blocks distribution is very good (blocks number
is close for each datanode, 2300 ~ 2500, < 10%).
So we can get benefit from using round robin if average blocks number in each
DN is small.
For random performance, agree with Colin that OpenSSL implementation is fast.
> Better random number generator
> ------------------------------
>
> Key: HADOOP-11152
> URL: https://issues.apache.org/jira/browse/HADOOP-11152
> Project: Hadoop Common
> Issue Type: Improvement
> Reporter: Luke Lu
> Labels: newbie++
>
> HDFS-7122 showed that naive ThreadLocal usage of simple LCG based j.u.Random
> creates unacceptable distribution of random numbers for block placement.
> Similarly, ThreadLocalRandom in java 7 (same static thread local with
> synchronized methods overridden) has the same problem.
> "Better" is defined as better quality and faster than j.u.Random (which is
> already much faster (20x) than SecureRandom).
> People (e.g. Numerical Recipes) have shown that by combining LCG and XORShift
> we can have a better fast RNG. It'd be worthwhile to investigate a thread
> local version of these "better" RNG.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)