Example Map and Reduce Slot Calculation
In the following example, the node has the following configuration:
Node Resources or Settings | Values |
---|---|
Services and Options | TaskTracker, MapR-FS, MapR-DB |
CPU/Core | 24 |
Disks Available to MapR-FS | 5 |
RAM | 48G |
Chunk Size | 256MB |
Based on this configuration, MapR Hadoop performs the following calculations to determine the number of map and reduce slots:
Calculation | Value | Description |
---|---|---|
Number of CPUs | 4 | Since MapR-DB is running, 4 CPUs are used to determine the slot calculation. |
Memory for Map Slots | 1G |
Since the chunk size is 256, 1G is allocated to memory for map slots. Warden
sets |
Memory for Reduce Slots |
3G |
Since the chunk size is 256, 3G is allocated to memory for map slots. Warden
sets |
Memory available to process MapReduce V1 tasks | 26G |
Based on the services running on the node, Warden calculates the memory
available to process MapReduce v1 tasks. In this example, Warden sets
|
Map Slots | 10 |
This value is based on the following calculations: = Min [ (0.4 *
mapred.tasktracker.map.tasks.maximum to 10. |
Reduce Slots | 3 |
This value is based on the following calculation: = Min [(0.6 *
|
Customizing the MapReduce v1 Slot Calculation Parameters
In general, you should not
need to customize the number of map and reduce slots because Warden determines these value
based on the resource available on the node. However, you can override the number of slots by
adding one or more of these parameters to mapred-site.xml. The mapred-site.xml file for
MapReduce v1 jobs is in the following location:
/opt/mapr/hadoop/hadoop-0.20.2/conf/mapred-site.xml
.
mapred-site.xml
, you must restart
TaskTracker. Warden uses the following parameters to calculate and assign values to map
slots and reduce slots on each node:Parameter | Default Value | Description |
---|---|---|
|
Warden uses the following formula to calculate this value: |
Defines the memory available to process MapReduce v1 tasks in MB. |
mapred.tasktracker.map.tasks.maximum
|
Warden uses a formula to calculate this value. For more information, see Criteria for Map Slot Calculation. | Defines the maximum number of MapReduce v1 map slots. |
mapred.tasktracker.reduce.tasks.maximum
|
Warden uses a formula to calculate this value. For more information, see Criteria for Reduce Slot Calculation. | Defines the maximum number of MapReduce v1 map slots. |
mapred.job.map.memory.physical.mb
|
If the chunk size is greater than or equal to 256M, then this value is set to 1G. Otherwise, this value is set to 0.5G. For information about configuring the chunk size, see Chunk Size. |
Defines the amount of memory allocated to map tasks in MB. |
mapred.job.reduce.memory.physical.mb
|
If the chunk size is greater than or equal to 256M, then this value is set to 3G. Otherwise, this value is set to 1.5G. For information about configuring the chunk size, see Chunk Size. |
Defines the amount of memory allocated to reduce tasks in MB. |