gpt4 book ai didi

hadoop - 为什么 HDFS 中的 block 这么大?

转载 作者:可可西里 更新时间:2023-11-01 14:09:22 26 4
gpt4 key购买 nike

有人可以解释这个计算并给出清晰的解释吗?

A quick calculation shows that if the seek time is around 10 ms and the transfer rate is 100 MB/s, to make the seek time 1% of the transfer time, we need to make the block size around 100 MB. The default is actually 64 MB, although many HDFS installations use 128 MB blocks. This figure will continue to be revised upward as transfer speeds grow with new generations of disk drives.

最佳答案

一个 block 将作为一个连续的信息存储在磁盘上,这意味着完全读取它的总时间是定位它的时间(寻道时间)+读取它的内容而不做任何更多寻道的时间,即 sizeOfTheBlock/transferRate = transferTime

如果我们将 seekTime/transferTime 的比率保持在较小的水平(接近文本中的 .01),这意味着我们从磁盘读取数据的速度几乎与磁盘施加的物理限制一样快,用最少的时间寻找信息。

这很重要,因为在 map reduce 作业中,我们通常遍历(读取)整个数据集(由 HDFS 文件或文件夹或文件夹集表示)并对其进行逻辑处理,因此我们必须花费全部 transferTime 无论如何,为了从磁盘中取出所有数据,让我们尽量减少大块查找和读取所花费的时间,因此数据 block 的大小很大。

在更传统的磁盘访问软件中,我们通常不会每次都读取整个数据集,因此我们宁愿花更多时间在较小的 block 上进行大量查找,也不愿浪费时间传输太多我们不会这样做的数据需要。

关于hadoop - 为什么 HDFS 中的 block 这么大?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22353122/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com