map和reduce任务的数量是如何确定的?
How is the number of map and reduce tasks is determined?
当运行 Hadoop 上的某些文件使用map reduce 时,有时它会创建1 个map 任务和1 个reduce 任务,而其他文件可以使用4 个map 和1 个reduce 任务。
我的问题是基于正在决定的 map 和 reduce 任务的数量?
是否有一定的 map/reduce 大小,之后会创建一个新的 map/reduce?
非常感谢大家。
来自 official doc :
The number of maps is usually driven by the number of DFS blocks in
the input files. Although that causes people to adjust their DFS block
size to adjust the number of maps. The right level of parallelism for
maps seems to be around 10-100 maps/node, although we have taken it up
to 300 or so for very cpu-light map tasks. Task setup takes awhile, so
it is best if the maps take at least a minute to execute.
理想的减速器应该是使它们最接近的最佳值:
- 块大小的倍数
- 任务时间在 5 到 15 分钟之间
- 尽可能创建最少的文件
除此之外的任何情况都意味着您的减速器很可能不太好。用户非常倾向于使用非常高的值 ("More parallelism means faster!") 或非常低的值 ("I don't want to blow my namespace quota!")。两者同样危险,会导致以下一种或多种情况:
- 工作流程下一阶段的糟糕表现
- 随机播放造成的糟糕表现
- 糟糕的整体性能,因为您用最终无用的对象
namenode
超载了
- 无缘无故地破坏磁盘 IO
- 大量网络传输
映射器的数量等于将要处理的输入文件的 HDFS 块数。
理想情况下,reducer 的数量应约为映射器总数的 10%。假设你有 100 个映射器,那么理想情况下,reducer 的数量应该在 10 个左右。
但是,可以在我们的 Map Reduce 作业中指定 reducer 的数量。
当运行 Hadoop 上的某些文件使用map reduce 时,有时它会创建1 个map 任务和1 个reduce 任务,而其他文件可以使用4 个map 和1 个reduce 任务。
我的问题是基于正在决定的 map 和 reduce 任务的数量?
是否有一定的 map/reduce 大小,之后会创建一个新的 map/reduce?
非常感谢大家。
来自 official doc :
The number of maps is usually driven by the number of DFS blocks in the input files. Although that causes people to adjust their DFS block size to adjust the number of maps. The right level of parallelism for maps seems to be around 10-100 maps/node, although we have taken it up to 300 or so for very cpu-light map tasks. Task setup takes awhile, so it is best if the maps take at least a minute to execute.
理想的减速器应该是使它们最接近的最佳值:
- 块大小的倍数
- 任务时间在 5 到 15 分钟之间
- 尽可能创建最少的文件
除此之外的任何情况都意味着您的减速器很可能不太好。用户非常倾向于使用非常高的值 ("More parallelism means faster!") 或非常低的值 ("I don't want to blow my namespace quota!")。两者同样危险,会导致以下一种或多种情况:
- 工作流程下一阶段的糟糕表现
- 随机播放造成的糟糕表现
- 糟糕的整体性能,因为您用最终无用的对象
namenode
超载了 - 无缘无故地破坏磁盘 IO
- 大量网络传输
映射器的数量等于将要处理的输入文件的 HDFS 块数。 理想情况下,reducer 的数量应约为映射器总数的 10%。假设你有 100 个映射器,那么理想情况下,reducer 的数量应该在 10 个左右。 但是,可以在我们的 Map Reduce 作业中指定 reducer 的数量。