Skip to main content

Configuring Tez Runtime

The behavior of Tez runtime is specified by the configuration file tez-site.xml in the classpath. MR3 inherits many configuration keys for Tez runtime from original Tez. For example, tez.runtime.io.sort.mb specifies the amount of memory required for sorting the output, and tez.runtime.shuffle.merge.percent specifies the fraction of shuffle data that should be merged at a time.

MR3 also introduces additional configuration keys which are specific to new features of MR3, and may interpret existing configuration keys in a different way.

Some runtime keys can be set for each LogicalInput or LogicalOutput in a DAG. Keys used to start ShuffleServer and shuffle handlers are fixed for all DAGs in the same application.

Below we describe the configuration keys for Tez runtime in MR3.

Vertex management and auto parallelism

NameDefault valueDescription
tez.shuffle-vertex-manager.desired-task-input-size104857600Desired input size in bytes per Task when auto parallelism is enabled.
tez.shuffle-vertex-manager.enable.auto-parallelfalsetrue: enable auto parallelism for ShuffleVertexManager. false: disable auto parallelism. For more details, see Auto Parallelism.
tez.shuffle-vertex-manager.auto-parallel.min.num.tasks20Minimum number of Tasks to trigger auto parallelism. For example, if the value is set to 20, only those Vertexes with at least 20 Tasks are considered for auto parallelism. The user can effectively disable auto parallelism by setting this configuration key to a large value.
tez.shuffle-vertex-manager.auto-parallel.max.reduction.percentage10Percentage of Tasks that can be kept after applying auto parallelism. For example, if the value is set to 10, the number of Tasks can be reduced by up to 90 percent, thereby leaving 10 percent of Tasks.
tez.shuffle-vertex-manager.min-task-parallelism1Minimum parallelism after applying auto parallelism.
tez.shuffle-vertex-manager.min-src-fraction0.25Fraction of source Tasks that should complete before scheduling Tasks in a Vertex with a ScatterGather edge.
tez.shuffle-vertex-manager.max-src-fraction0.75Fraction of source Tasks at which all Tasks in a Vertex with a ScatterGather edge can be scheduled. Between the minimum and maximum fractions, the number of Tasks ready for scheduling increases linearly.
tez.shuffle-vertex-manager.use-stats-auto-parallelismfalsetrue: analyze input statistics when applying auto parallelism. false: do not use input statistics.

Runtime data comparison and partitioning

NameDefault valueDescription
tez.runtime.key.secondary.comparator.classnoneSecondary comparator class for grouped keys. If unset, the key comparator is used.
tez.runtime.partitioner.classnonePartitioner class for partitioned output.
tez.runtime.report.partition.statsmemory_optimizedMethod for reporting partition statistics to ShuffleVertexManager. Valid values are none, memory_optimized, and precise.

Output sorting, buffering, and spilling

NameDefault valueDescription
tez.runtime.io.sort.factor100Maximum number of streams to merge at a time while sorting output.
tez.runtime.io.sort.mb100Amount of memory in MB for sorting output.
tez.runtime.pipelined.sorter.min-block.size.in.mb2000Minimum size in MB of a block allocated by PipelinedSorter.
tez.runtime.pipelined.sorter.use.soft.referencefalsetrue: use soft references for ByteBuffers allocated in PipelinedSorter. These soft references are reused across TaskAttempts running in the same ContainerWorker. false: do not use soft references.
tez.runtime.pipelined.sorter.lazy-allocate.memoryfalsetrue: allocate sorter memory progressively when needed. false: allocate all sorter memory during initialization.
tez.runtime.pipelined.sorter.rle.threshold0.1Fraction used as the threshold for run-length encoding in PipelinedSorter.
tez.runtime.unordered.partitioned.non.pipelined.num.buffers4Number of buffers for non-pipelined unordered partitioned output.
tez.runtime.unordered.output.buffer.size-mb100Size in MB of the buffer for unordered output when data is not written directly to disk.
tez.runtime.unordered.non.pipelined.spill.compressfalsetrue: compress spills from non-pipelined unordered output. false: do not compress these spills.

Input buffering, merging, and IFile

NameDefault valueDescription
tez.runtime.ifile.readaheadtruetrue: enable readahead while reading IFile data. false: disable readahead.
tez.runtime.ifile.readahead.bytes4194304Number of bytes to read ahead from an IFile.
tez.runtime.shuffle.fetch.buffer.percent0.9Fraction of assigned memory used to buffer shuffle input.
tez.runtime.shuffle.memory.limit.percent0.25Maximum fraction of assigned memory used by a single shuffle input.
tez.runtime.shuffle.merge.percent0.9Fraction of shuffle memory at which merging starts.
tez.runtime.shuffle.memory-to-memory.segmentstez.runtime.io.sort.factorMaximum number of in-memory segments to merge at a time. If unset, the value of tez.runtime.io.sort.factor is used.
tez.runtime.shuffle.memory-to-memory.enablefalsetrue: enable memory-to-memory merging for ordered shuffle input. false: disable memory-to-memory merging.
tez.runtime.task.input.post-merge.buffer.percent0.9Fraction of assigned memory reserved for shuffle input after the final merge.

Compression

NameDefault valueDescription
tez.runtime.compressfalsetrue: compress intermediate output. false: do not compress intermediate output.
tez.runtime.compress.codecnoneCompression codec class for intermediate output.

Pipelined shuffle and event-based transfer

NameDefault valueDescription
tez.runtime.pipelined-shuffle.enabledfalsetrue: use pipelined shuffling for unordered output. false: do not use pipelined shuffling for unordered output. If set to true/false, tez.runtime.enable.final-merge.in.output is automatically set to false/true, respectively.
tez.runtime.pipelined-shuffle.ordered.enabledfalsetrue: use pipelined shuffling for ordered output. false: do not use pipelined shuffling for ordered output.
tez.runtime.transfer.data-via-events.enabledtruetrue: embed unordered data directly in messages of type DataMovementEvent. false: do not embed unordered data. Effective only for Vertexes with a single output partition.
tez.runtime.transfer.data-via-events.max-size2048Maximum size in bytes of unordered data that can be embedded directly in a DataMovementEvent.

Memory-backed input and output

NameDefault valueDescription
tez.runtime.use.free.memory.fetched.inputfalsetrue: if enough free memory is available, fetchers keep shuffle input in memory instead of spilling to local disks. false: fetchers do not consider the size of free memory.
tez.runtime.free.memory.factor.for.fetched.input1.0Multiplier used in calculating the total amount of free memory for storing shuffle input data per LogicalInput.
tez.runtime.shuffle.unordered.memory.streamingfalsetrue: fetchers do not write unordered data to local disks. false: fetchers may write unordered data to local disks.
tez.runtime.use.free.memory.writer.outputfalsetrue: if enough free memory is available, Tasks store their output in memory instead of writing to local disks. false: Tasks write their output to local disks. If set to true, set hive.mr3.delete.vertex.local.directory to true in hive-site.xml.
tez.runtime.free.memory.writer.output.threshold.mb6144Free memory threshold in MB for writing output in memory when tez.runtime.use.free.memory.writer.output is set to true.

ShuffleServer and fetchers

NameDefault valueDescription
tez.am.shuffle.auxiliary-service.idmapreduce_shuffleService ID for the external shuffle service. Set to tez_shuffle to use MR3 shuffle handlers. Must be set to tez_shuffle on Kubernetes and in standalone mode.
tez.runtime.shuffle.parallel.copies20Maximum number of fetchers per LogicalInput. A single RuntimeTask can create several LogicalInputs.
tez.runtime.shuffle.total.parallel.copies40Maximum number of fetchers per ContainerWorker.
tez.runtime.shuffle.fetch.max.task.output.at.once20Maximum number of Task output files to fetch per request. A large value can cause HTTP 400 errors.
tez.runtime.shuffle.ranges.schemepriorityScheme used by ShuffleServer to select a LogicalInput for shuffling.
tez.runtime.shuffle.connection.fail.all.inputfalsetrue: fail all inputs in a fetch request when the connection fails. false: do not fail all inputs.
tez.runtime.shuffle.connect.timeout27500Maximum time in milliseconds for trying to connect to the shuffle service or the built-in shuffle handler before reporting fetch failures. For more details, see Fault Tolerance.
tez.runtime.shuffle.keep-alive.enabledfalsetrue: keep connections alive for reuse in fetchers. false: do not reuse connections.
tez.runtime.shuffle.keep-alive.max.connections20Maximum number of keep-alive connections used by fetchers.
tez.runtime.shuffle.read.timeout120000Maximum time in milliseconds for reading shuffle data before a timeout.
tez.runtime.shuffle.buffersize8192Size in bytes of the network buffer used by fetchers.
tez.runtime.shuffle.ssl.enablefalsetrue: use SSL for shuffle transfers. false: do not use SSL.
tez.runtime.shuffle.fetch.verify-disk-checksumtruetrue: verify checksums when fetching data directly to disk. false: do not verify checksums.
tez.runtime.optimize.local.fetchtruetrue: read unordered data on local disks directly. false: read unordered data through fetchers. Automatically set to false when using memory-to-memory shuffling.
tez.runtime.optimize.local.fetch.orderedtruetrue: read ordered data on local disks directly. false: read ordered data through fetchers. Automatically set to false when using memory-to-memory shuffling.

Shuffle handlers

NameDefault valueDescription
tez.shuffle.connection-keep-alive.enablefalsetrue: keep connections alive for reuse. false: do not reuse connections.
tez.shuffle.connection-keep-alive.timeout5Timeout in seconds for keep-alive connections.
tez.shuffle.max.connections0Maximum number of shuffle connections. The default value of 0 sets no limit.
tez.shuffle.max.threads0Number of threads for each shuffle handler. The default value of 0 sets the number of threads to twice the number of cores.
tez.shuffle.transfer.buffer.size131072Size in bytes of the shuffle transfer buffer.
tez.shuffle.transferTo.allowedtruetrue: allow transferTo for shuffle transfers. false: do not use transferTo. The default is false on Windows.
tez.shuffle.max.session-open-files3Maximum number of files that a single shuffle request can open at the same time.
tez.shuffle.listen.queue.size128Size of the listening queue. Can be set to the value in /proc/sys/net/core/somaxconn.
tez.shuffle.port13563Port number for shuffle handlers. If a ContainerWorker fails to secure the port, it chooses a random port instead.
tez.shuffle.mapoutput-info.meta.cache.size1000Number of map output metadata entries kept in the cache.
tez.shuffle.ssl.file.buffer.size61440Size in bytes of the SSL file buffer.
tez.shuffle.skip.verify.requestfalsetrue: MR3 shuffle handlers skip checking the validity of shuffle requests. false: MR3 shuffle handlers check the validity of shuffle requests. Effective only for MR3 shuffle handlers using tez_shuffle.

Backpressure and speculative fetching

NameDefault valueDescription
tez.shuffle.max.block.requests.thread.multiple2Multiplier used in calculating the maximum number of active shuffle requests allowed per ContainerWorker before backpressure is triggered.
tez.runtime.shuffle.speculative.fetch.wait.millis12500Elapsed time in milliseconds for a fetcher before triggering speculative fetching.
tez.runtime.shuffle.stuck.fetcher.threshold.millis2500Elapsed time in milliseconds for a fetcher before triggering backpressure and blocking further connections to the shuffle handler.
tez.runtime.shuffle.stuck.fetcher.release.millis10000Elapsed time in milliseconds after which backpressure is lifted, resuming the creation of fetchers that contact the previously blocked shuffle handler.
tez.runtime.shuffle.max.speculative.fetch.attempts2Maximum number of speculative fetchers for each fetch attempt.

Configuration keys fixed per application

The following configuration keys are read when starting ShuffleServer and are fixed for all DAGs in the same application. They cannot be changed for each DAG's LogicalInput or LogicalOutput.

  • tez.runtime.shuffle.total.parallel.copies
  • tez.runtime.shuffle.fetch.max.task.output.at.once
  • tez.runtime.shuffle.ranges.scheme
  • tez.runtime.shuffle.connection.fail.all.input
  • tez.runtime.shuffle.connect.timeout
  • tez.runtime.shuffle.keep-alive.enabled
  • tez.runtime.shuffle.keep-alive.max.connections
  • tez.runtime.shuffle.read.timeout
  • tez.runtime.shuffle.buffersize
  • tez.runtime.shuffle.ssl.enable
  • tez.runtime.shuffle.fetch.verify-disk-checksum
  • tez.runtime.optimize.local.fetch
  • tez.runtime.optimize.local.fetch.ordered