Organízate con las colecciones
Guarda y clasifica el contenido según tus preferencias.
Las tareas por lotes usan Dataflow Shuffle de forma predeterminada.
Dataflow Shuffle traslada la operación Shuffle fuera de las máquinas virtuales de trabajadores y la ubica en el backend del servicio Dataflow.
La información de esta página se aplica a los trabajos por lotes. Las tareas de streaming usan un mecanismo de aleatorización diferente, llamado aleatorización de streaming.
Acerca de Shuffle de Dataflow
Dataflow Shuffle es la operación básica que hay detrás de las transformaciones de Dataflow, como GroupByKey, CoGroupByKey y Combine.
La operación Shuffle de Dataflow particiona y agrupa los datos por clave de manera escalable, eficiente y tolerante a fallos.
Ventajas de Dataflow Shuffle
El shuffle de Dataflow basado en servicios ofrece las siguientes ventajas:
Tiempo de ejecución más rápido de las canalizaciones por lotes para la mayoría de los tipos de tareas de canalización.
Una reducción de los recursos de CPU, memoria y almacenamiento de disco persistente consumidos en las VMs de los trabajadores.
Mejor escalado horizontal automático, ya que
las VMs no contienen datos de aleatorización y, por lo tanto, se pueden reducir antes.
Mayor tolerancia a fallos, ya que una máquina virtual en mal estado que contenga datos de aleatorización de Dataflow no provoca que falle toda la tarea.
Compatibilidad y limitaciones
Esta función está disponible en todas las regiones en las que se admite Dataflow. Para ver las ubicaciones disponibles, consulta el artículo sobre ubicaciones de Dataflow. Puede haber diferencias de rendimiento entre regiones.
Los trabajadores deben desplegarse en la misma región que el trabajo de Dataflow.
No especifique la opción zone del flujo de procesamiento. En su lugar, especifique el region y asigne el valor a una de las regiones disponibles. Dataflow selecciona automáticamente la zona de la región que hayas especificado.
Si especificas la opción zone
pipeline y la asignas a una zona que no se encuentra en las regiones disponibles, la tarea de Dataflow devuelve un error. Si defines una combinación incompatible de region y zone, tu trabajo no podrá usar el orden aleatorio de Dataflow.
En Python, el orden aleatorio de Dataflow requiere la versión 2.1.0 o posterior del SDK de Apache Beam para Python.
Consideraciones sobre el tamaño del disco
El tamaño de disco de arranque predeterminado de cada tarea por lotes es de 25 GB. En algunas tareas por lotes, es posible que tengas que modificar el tamaño del disco. Ten en cuenta lo siguiente:
Una máquina virtual de trabajador usa parte de los 25 GB de espacio en disco para el sistema operativo, los archivos binarios, los registros y los contenedores. Los trabajos que usan una cantidad significativa de disco y superan la capacidad de disco restante pueden fallar cuando se usa el orden aleatorio de Dataflow.
Los trabajos que usan muchas operaciones de E/S de disco pueden ser lentos debido al rendimiento del disco pequeño. Para obtener más información sobre las diferencias de rendimiento entre los tamaños de disco, consulta la página Rendimiento de los discos persistentes de Compute Engine.
Para especificar un tamaño de disco mayor para una tarea de Shuffle de Dataflow, puedes usar el parámetro --disk_size_gb.
Precios
La mayor parte de la reducción de los recursos de los trabajadores se debe a la descarga del trabajo de orden aleatorio en el servicio Dataflow. Por este motivo, se aplica un cargo por usar el orden aleatorio de Dataflow. Los tiempos de ejecución pueden variar de una ejecución a otra. Si estás ejecutando una
pipeline que tiene plazos importantes, te recomendamos que asignes suficiente
tiempo de margen antes de la fecha límite.
[[["Es fácil de entender","easyToUnderstand","thumb-up"],["Me ofreció una solución al problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Es difícil de entender","hardToUnderstand","thumb-down"],["La información o el código de muestra no son correctos","incorrectInformationOrSampleCode","thumb-down"],["Me faltan las muestras o la información que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-10 (UTC)."],[[["\u003cp\u003eDataflow shuffle, which is used by default for batch jobs, moves shuffle operations to the Dataflow service backend, improving efficiency.\u003c/p\u003e\n"],["\u003cp\u003eDataflow shuffle is the foundational operation for Dataflow transforms like \u003ccode\u003eGroupByKey\u003c/code\u003e, \u003ccode\u003eCoGroupByKey\u003c/code\u003e, and \u003ccode\u003eCombine\u003c/code\u003e, enabling scalable and fault-tolerant data partitioning and grouping.\u003c/p\u003e\n"],["\u003cp\u003eBenefits of Dataflow shuffle include faster batch pipeline execution, reduced worker VM resource consumption, improved horizontal autoscaling, and better fault tolerance.\u003c/p\u003e\n"],["\u003cp\u003eDataflow shuffle is not available for streaming jobs and requires worker VMs to be deployed in the same region as the Dataflow job, avoiding the specification of a \u003ccode\u003ezone\u003c/code\u003e pipeline option.\u003c/p\u003e\n"],["\u003cp\u003eDataflow shuffle charges apply, and the default 25 GB boot disk size may need to be increased for jobs with heavy disk I/O to ensure optimal performance.\u003c/p\u003e\n"]]],[],null,["Batch jobs use Dataflow shuffle by default.\nDataflow shuffle\nmoves the shuffle operation out of the worker VMs and into the\nDataflow service backend.\n\nThe information on this page applies to batch jobs. Streaming jobs use a\ndifferent shuffle mechanism, called\n[streaming shuffle](/dataflow/docs/concepts/exactly-once#streaming-shuffle).\n\nAbout Dataflow shuffle\n\n- Dataflow shuffle is the base operation behind Dataflow transforms such as `GroupByKey`, `CoGroupByKey`, and `Combine`.\n- The Dataflow shuffle operation partitions and groups data by key in a scalable, efficient, fault-tolerant manner.\n\nBenefits of Dataflow shuffle\n\nThe service-based Dataflow shuffle has the following benefits:\n\n- Faster execution time of batch pipelines for the majority of pipeline job types.\n- A reduction in consumed CPU, memory, and Persistent Disk storage resources on the worker VMs.\n- Better [Horizontal Autoscaling](/dataflow/docs/horizontal-autoscaling), because VMs don't hold any shuffle data and can therefore be scaled down earlier.\n- Better fault tolerance, because an unhealthy VM holding Dataflow shuffle data doesn't cause the entire job to fail.\n\nSupport and limitations\n\n- This feature is available in all regions where Dataflow is supported. To see available locations, read [Dataflow locations](/dataflow/docs/resources/locations). There might be performance differences between regions.\n- Workers must be deployed in the same region as the Dataflow job.\n- Don't specify the `zone` pipeline option. Instead, specify the `region`, and\n set the value to one of the available regions. Dataflow\n automatically selects the zone in the region you specified.\n\n If you specify the `zone`\n pipeline option and set it to a zone outside of the available regions, the\n Dataflow job returns an error. If you set an incompatible combination\n of `region` and `zone`, your job can't use Dataflow shuffle.\n- For Python, Dataflow shuffle requires Apache Beam SDK\n for Python version 2.1.0 or later.\n\nDisk size considerations\n\nThe default boot disk size for each batch job is 25 GB. For some batch jobs,\nyou might be required to modify the size of the disk. Consider the following:\n\n- A worker VM uses part of the 25 GB of disk space for the operating system, binaries, logs, and containers. Jobs that use a significant amount of disk and exceed the remaining disk capacity may fail when you use Dataflow shuffle.\n- Jobs that use a lot of disk I/O may be slow due to the performance of the small disk. For more information about performance differences between disk sizes, see [Compute Engine Persistent Disk Performance](/compute/docs/disks/performance).\n\nTo specify a larger disk size for a Dataflow shuffle job, you can\nuse the [`--disk_size_gb`](/dataflow/pipelines/specifying-exec-params#setting-other-cloud-pipeline-options)\nparameter.\n\nPricing\n\nMost of the reduction in worker resources comes from offloading the shuffle work\nto the Dataflow service. For that reason, there is a\n[charge](/dataflow/pricing) associated with the use of Dataflow\nshuffle. The execution times might vary from run to run. If you are running\na pipeline that has important deadlines, we recommend allocating sufficient\nbuffer time before the deadline."]]