自動垂直調度資源功能可讓 Dataflow Prime 動態擴充或縮減工作站可用的記憶體,以符合工作需求。這項功能旨在讓作業免於記憶體不足 (OOM) 錯誤,並盡可能提高管道效率。Dataflow Prime 會監控管道,偵測工作站記憶體不足或過多的情況,然後以記憶體較多或較少的新工作站取代這些工作站。
Vertical Autoscaling has a desire to upscale memory, but we have hit the memory
scaling limit of X GiB. This is only a problem if the pipeline continues to see
memory throttling and/or OOMs.
批次工作:
Vertical Autoscaling has a desire to upscale memory, but we have hit the memory
scaling limit of 16.0 GiB. Job will fail because we have upsized to maximum
size, and the pipeline is still OOMing.
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eVertical Autoscaling dynamically adjusts worker memory in Dataflow Prime to prevent out-of-memory errors and maximize pipeline efficiency by replacing workers with new ones that have adjusted memory.\u003c/p\u003e\n"],["\u003cp\u003eVertical Autoscaling is enabled by default for new streaming jobs using Dataflow Prime, but for batch jobs it must be explicitly enabled with specific pipeline options and it will only scale up after four out-of-memory errors occur.\u003c/p\u003e\n"],["\u003cp\u003eWhile Vertical Autoscaling only scales worker memory vertically, it operates alongside Horizontal Autoscaling to dynamically adjust the number of workers, though horizontal scaling is temporarily deactivated after a vertical scaling event.\u003c/p\u003e\n"],["\u003cp\u003eMemory scaling has default limits of 6-16 GiB (12-26 GiB with GPUs) per worker, but these can be adjusted using resource hints, and Vertical Autoscaling is not compatible with VPC Service Controls or A100 GPUs.\u003c/p\u003e\n"],["\u003cp\u003eIf vertical scaling doesn't seem to work, verify the job message, \u003ccode\u003eenable_vertical_memory_autoscaling\u003c/code\u003e flag and the \u003ccode\u003eenable_batch_vmr\u003c/code\u003e flag for batch pipelines, the Cloud Autoscaling API, and that Dataflow Prime is enabled.\u003c/p\u003e\n"]]],[],null,["# Vertical Autoscaling is a feature that enables\n[Dataflow Prime](/dataflow/docs/guides/enable-dataflow-prime) to dynamically\nscale up or scale down the memory available to workers to fit the requirements\nof the job. The feature is designed to make jobs resilient to out-of-memory\n(OOM) errors and to maximize pipeline efficiency. Dataflow Prime monitors\nyour pipeline, detects situations where the workers lack or exceed available\nmemory, and then replaces those workers with new workers with more or less\nmemory.\n\n**Important:** Because Vertical Autoscaling replaces existing workers with new\nworkers, we strongly recommend [using custom\ncontainers](/dataflow/docs/guides/using-custom-containers) to improve the\nlatency that might arise from resizing the workers.\n\nStreaming\n---------\n\nVertical Autoscaling is enabled by default for all new streaming jobs that [use\nDataflow Prime](/dataflow/docs/guides/enable-dataflow-prime#enable-prime).\n\nIf you are launching a job from a template through the command line interface,\nyou can disable Vertical Autoscaling by passing the\n`--additional_experiments=disable_vertical_memory_autoscaling` flag.\n\nAll Dataflow Prime streaming Java and Python pipelines support Vertical\nAutoscaling. You can use Dataflow Prime streaming Java pipelines without\nStreaming Engine. However, for the best experience with Vertical Autoscaling,\nenabling Streaming Engine is recommended.\n\nBatch\n-----\n\nFor Dataflow Prime batch jobs, Vertical Autoscaling only scales up after four\nout-of-memory errors occur.\n\n- Vertical Autoscaling scales up to prevent job failures and does not scale down.\n- The entire pool scales up for the remainder of the job.\n- If resource hints are used and multiple pools are created, each pool scales up separately.\n\nFor batch jobs, Vertical Autoscaling is not enabled by default. To enable\nVertical Autoscaling for batch jobs, set the following pipeline options:\n\n- `--experiments=enable_batch_vmr`\n- `--experiments=enable_vertical_memory_autoscaling`\n\nTo disable Vertical Autoscaling for batch jobs, do one of the following:\n\n- Do not set the `--experiments=enable_batch_vmr` pipeline option.\n- Set the `--experiments=disable_vertical_memory_autoscaling` pipeline option.\n\nLimitations\n-----------\n\n- Only the memory of the workers scales vertically.\n- By default, memory scaling has an upper limit of 16 GiB and a lower limit of 6 GiB. When you [use GPUs](/dataflow/docs/gpu), memory scaling has an upper limit of 26 GiB and a lower limit of 12 GiB. You can change both the upper and lower limits by providing a resource hint.\n- Vertical Autoscaling is not supported for pools using A100 GPUs.\n- For batch jobs, bundles that include a failing item might be retried more than 4 times before the pipeline fails completely.\n- Vertical Autoscaling isn't supported with [VPC Service Controls](/vpc-service-controls/docs/overview). If you enable Dataflow Prime and launch a new job within a VPC Service Controls perimeter, the job uses [Dataflow Prime without Vertical\n Autoscaling](/dataflow/docs/guides/enable-dataflow-prime#features).\n- When you use right fitting with Vertical Autoscaling, only batch pipelines are supported.\n\nMonitor Vertical Autoscaling\n----------------------------\n\nVertical Autoscaling operations are published to the job and worker logs. To\nview these logs, see [Dataflow job\nmetrics](/dataflow/docs/guides/using-monitoring-intf).\n\nEffect on Horizontal Autoscaling\n--------------------------------\n\nIn [Dataflow Prime](/dataflow/docs/guides/enable-dataflow-prime), Vertical\nAutoscaling works alongside [Horizontal\nAutoscaling](/dataflow/docs/horizontal-autoscaling). This combination enables\nDataflow Prime to seamlessly scale workers up or down to best fit the needs\nof your pipeline and maximize the utilization of the compute capacity.\n\nBy design, Vertical Autoscaling (which adjusts the worker memory) occurs at a\nlower frequency than Horizontal Autoscaling (which adjusts the number of\nworkers). Horizontal Autoscaling is deactivated during and up to 10 minutes\nafter an update is triggered by Vertical Autoscaling. If there exists a\nsignificant backlog of input data after this 10-minute mark, Horizontal\nAutoscaling is likely to occur to clear that backlog. To learn about Horizontal\nAutoscaling for streaming pipelines, see [Streaming\nautoscaling](#streaming).\n\nTroubleshooting\n---------------\n\nThis section provides instructions for troubleshooting common issues related to\nvertical autoscaling.\n\n### Vertical Autoscaling does not seem to work\n\nIf Vertical Autoscaling isn't working, check the following job details.\n\n- Check for the following job message to verify that Vertical Autoscaling is\n active:\n `Vertical Autoscaling is enabled. This pipeline is receiving recommendations\n for resources allocated per worker.`\n\n The absence of this message indicates that Vertical Autoscaling is not\n running.\n- For streaming pipelines, verify that the\n `enable_vertical_memory_autoscaling` flag is set. For batch pipelines,\n verify that the `enable_vertical_memory_autoscaling` and the\n `enable_batch_vmr` flags are set.\n\n- Verify that you enabled the Cloud Autoscaling API for your Google Cloud project.\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=autoscaling.googleapis.com)\n\n- Verify that your job is running Dataflow Prime. For more information, see\n [Enabling\n Dataflow Prime](/dataflow/docs/guides/enable-dataflow-prime#enable-prime).\n\n### Job observes high backlog and high watermark\n\nThese instructions only apply to streaming jobs. If the vertical reshaping of\nworkers takes longer than a few minutes, your\njob might exhibit a high backlog of the input data and a high watermark. To\naddress this issue in Python pipelines, we strongly recommend that you\n[use custom containers](/dataflow/docs/guides/using-custom-containers), because\nthey can improve the latency that might arise from reshaping the workers. To\naddress this issue in Java pipelines, we strongly recommend that you enable\n[Streaming Engine](/dataflow/docs/streaming-engine)\nand [Runner v2](/dataflow/docs/runner-v2).\nIf the issue persists after enabling these features, contact\n[Customer Care](https://cloud.google.com/support-hub).\n\n### Vertical Autoscaling has reached the memory capacity.\n\nBy default, if no resource hints are provided, Vertical Autoscaling does not\nscale memory beyond 16 GiB per worker (26 GiB when using GPUs) or less\nthan 6 GiB per worker (12 GiB when using GPUs). When these limits are\nreached, one of the following log messages is generated in Cloud Logging.\n\nStreaming jobs:\n\n`Vertical Autoscaling has a desire to upscale memory, but we have hit the memory\nscaling limit of X GiB. This is only a problem if the pipeline continues to see\nmemory throttling and/or OOMs.`\n\nBatch jobs:\n\n`Vertical Autoscaling has a desire to upscale memory, but we have hit the memory\nscaling limit of 16.0 GiB. Job will fail because we have upsized to maximum\nsize, and the pipeline is still OOMing.`\n\nIf your pipeline continues to see out-of-memory errors, you can use [right\nfitting](/dataflow/docs/guides/right-fitting) (resource hints) to define memory\nrequirements for your transform by specifying `min_ram=\"numberXB\"`. This setting\nallows Dataflow to select an initial configuration for your\nworkers that can support a higher memory capacity. However, changing this\ninitial configuration can increase the latent parallelism available to your\npipeline. If you have a memory-hungry transform, this might result in your\npipeline using more memory than before due to the increased available\nparallelism. In such cases, it might be necessary to optimize your transform to\nreduce its memory footprint.\n| **Note:** Vertical Autoscaling does not prevent OOM errors from appearing in the worker logs. If an OOM error occurs, it is visible in the worker logs, because Vertical Autoscaling finds and tracks the OOM events.\n\n### Worker memory limit doesn't stabilize and goes up and down over time despite constant memory use\n\nThese instructions only apply to streaming jobs.\nFor Java pipelines, enable [Streaming Engine](/dataflow/docs/streaming-engine)\nand [Runner v2](/dataflow/docs/runner-v2).\nIf the issue persists or if you observe this behavior in Python pipelines,\ncontact [Customer Care](https://cloud.google.com/support-hub).\n\nCommon log messages\n-------------------\n\nThis section describes the common log messages generated when you enable\nVertical Autoscaling.\n\n### Vertical Autoscaling is enabled. This pipeline is receiving recommendations for resources allocated per worker.\n\nThis message indicates that Vertical Autoscaling is active. The absence of this\nmessage indicates that Vertical Autoscaling is not operating on the worker pool.\n\nIf Vertical Autoscaling is not active, see [Vertical Autoscaling does not seem\nto work. What should I\ncheck?](/dataflow/docs/vertical-autoscaling#vertical_autoscaling_does_not_seem_to_work_what_should_i_check)\nfor troubleshooting instructions.\n\n### Vertical Autoscaling update triggered to change per worker memory limit for pool from X GiB to Y GiB.\n\nThis message indicates that Vertical Autoscaling has triggered a resize of the\nworker pool memory."]]