El 15 de septiembre del 2026, todos los entornos de Cloud Composer 1 y Cloud Composer 2 versión 2.0.x alcanzarán el final de su ciclo de vida previsto y no podrás usarlos. Te recomendamos que planifiques la migración a Cloud Composer 3.
Sigue las instrucciones de esta página para habilitar o inhabilitar la serialización de DAGs.
En un entorno de Cloud Composer, tanto el programador de Airflow como el servidor web de Airflow procesan continuamente los DAGs. Puedes mejorar la fiabilidad y el rendimiento del servidor web de Airflow habilitando la serialización de DAGs.
Si habilitas la serialización de DAG, el programador procesará los archivos de DAG antes de enviarlos al servidor web. El servidor web no procesa DAGs.
En su lugar, lee los DAGs serializados de la base de datos de Airflow. La serialización de DAGs de esta forma reduce el uso de CPU y memoria del servidor web, especialmente cuando se procesa un gran número de DAGs.
Antes de empezar
La serialización de DAG afecta a las siguientes funciones de Cloud Composer:
La serialización de DAGs no se puede habilitar al mismo tiempo que la carga asíncrona de DAGs.
Si habilitas la serialización de DAGs, se inhabilitarán todos los complementos del servidor web de Airflow en Cloud Composer. Esto no afecta a los complementos de programador ni de trabajador, incluidos los operadores y sensores de Airflow, entre otros.
Habilitar la serialización de DAG
Puedes habilitar la serialización de DAG en un entorno que ya tengas o al crear uno nuevo.
Para habilitar la serialización de DAGs, anula las siguientes opciones de configuración de Airflow:
Sección
Clave
Valor
core
store_serialized_dags
True
core
store_dag_code
True
core
min_serialized_dag_update_interval
30
scheduler
dag_dir_list_interval
30
La opción de configuración de min_serialized_dag_update_interval
Airflow controla con qué frecuencia se actualizan los DAGs serializados en la base de datos.
La opción dag_dir_list_interval
controla la frecuencia con la que se eliminan los DAGs de la base de datos de Airflow. Una frecuencia de actualización alta puede afectar negativamente al rendimiento. Te recomendamos que definas min_serialized_dag_update_interval y dag_dir_list_interval en 30 segundos.
Inhabilitar la serialización de DAG
Puedes habilitar la serialización de DAG en un entorno que ya tengas o al crear uno nuevo.
Para inhabilitar la serialización de DAGs, anula las siguientes opciones de configuración de Airflow:
[[["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-08-29 (UTC)."],[[["\u003cp\u003eDAG serialization in Cloud Composer improves the reliability and performance of the Airflow web server by having the scheduler process DAG files before they are sent, reducing the web server's CPU and memory usage.\u003c/p\u003e\n"],["\u003cp\u003eStarting with Cloud Composer version 1.15.0, DAG serialization is enabled by default, and it can be managed by overriding Airflow configuration options in both new and existing environments.\u003c/p\u003e\n"],["\u003cp\u003eEnabling DAG serialization requires setting the \u003ccode\u003estore_serialized_dags\u003c/code\u003e and \u003ccode\u003estore_dag_code\u003c/code\u003e Airflow configuration options to \u003ccode\u003eTrue\u003c/code\u003e, along with recommended settings of \u003ccode\u003e30\u003c/code\u003e for both \u003ccode\u003emin_serialized_dag_update_interval\u003c/code\u003e and \u003ccode\u003edag_dir_list_interval\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eDisabling DAG serialization involves overriding the \u003ccode\u003estore_serialized_dags\u003c/code\u003e and \u003ccode\u003estore_dag_code\u003c/code\u003e Airflow configuration options and setting them to \u003ccode\u003eFalse\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eDAG serialization is incompatible with asynchronous DAG loading and will disable all Airflow web server plugins, although scheduler and worker plugins remain unaffected.\u003c/p\u003e\n"]]],[],null,["\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\nCloud Composer 3 \\| Cloud Composer 2 \\| **Cloud Composer 1**\n\n\u003cbr /\u003e\n\nFollow the instructions on this page to enable or disable DAG serialization.\n\nIn a Cloud Composer environment, both the Airflow scheduler and\nthe Airflow web server continuously process DAGs. You can improve\nthe reliability and performance of the Airflow web server by enabling\n[DAG serialization](https://airflow.apache.org/docs/apache-airflow/stable/dag-serialization.html).\n\nEnabling DAG serialization forces the scheduler to process DAG files\nbefore they are sent to the web server. The web server does not process DAGs.\nInstead, it reads the serialized DAGs from the Airflow database. Serializing\nDAGs in this way reduces the CPU and memory usage of the web server,\nespecially when processing a large number of DAGs.\n\nBefore you begin **Note:** Starting from Cloud Composer version **1.15.0** , DAG serialization is enabled by default. You can enable and disable DAG serialization in new and existing environments by [overriding Airflow configuration options](/composer/docs/composer-2/override-airflow-configurations), as described in the following sections.\n\nDAG serialization affects the following Cloud Composer features:\n\n- DAG serialization cannot be enabled at the same time as [asynchronous DAG loading](/composer/docs/composer-2/access-airflow-web-interface#asynchronous-load).\n- Enabling DAG serialization disables all Airflow web server plugins for Cloud Composer. This does not impact scheduler or worker plugins, including Airflow operators, sensors, and so on.\n\nEnabling DAG serialization\n\nYou can enable DAG serialization for an existing environment or when creating a\nnew environment.\n| **Note:** Do not apply these settings to environments running Airflow 2.x. The DAG serialization and storing DAG code in Airflow Metadata Database is by default turned on in Airflow 2.x and you cannot switch it on or off.\n\nTo enable DAG serialization,\n[override](/composer/docs/composer-2/override-airflow-configurations) the following Airflow configuration options:\n\n| Section | Key | Value |\n|-------------|--------------------------------------|--------|\n| `core` | `store_serialized_dags` | `True` |\n| `core` | `store_dag_code` | `True` |\n| `core` | `min_serialized_dag_update_interval` | `30` |\n| `scheduler` | `dag_dir_list_interval` | `30` |\n\nThe [`min_serialized_dag_update_interval`](https://airflow.apache.org/docs/stable/configurations-ref.html#min-serialized-dag-update-interval)\nAirflow configuration option controls how frequently serialized DAGs\nare updated in the database.\nThe [`dag_dir_list_interval`](https://airflow.apache.org/docs/stable/configurations-ref.html#dag-dir-list-interval)\noption controls how frequently removed DAGs are deleted from the Airflow\ndatabase. A high update frequency can negatively impact performance. We\nrecommend setting `min_serialized_dag_update_interval` and\n`dag_dir_list_interval` to 30 seconds.\n\nDisabling DAG serialization\n\nYou can enable DAG serialization for an existing environment or when creating\na new environment.\n\nTo disable DAG serialization, [override](/composer/docs/composer-2/override-airflow-configurations) the following Airflow\nconfiguration options:\n\n| Section | Key | Value |\n|---------|-------------------------|---------|\n| `core` | `store_serialized_dags` | `False` |\n| `core` | `store_dag_code` | `False` |"]]