데이터베이스 보존 정책을 설정하여 Cloud Composer 3 환경의 자동 데이터베이스 정리를 구성할 수 있습니다. 이 정책을 설정하면 일정 기간이 지난 레코드는 매일 Airflow 데이터베이스에서 자동으로 삭제됩니다. 자세한 내용은 데이터베이스 보관 정책 구성을 참고하세요.
지원 중단된 정리 절차
Cloud Composer에서 데이터베이스 보관 정책을 사용할 수 있기 전에는 데이터베이스 정리 DAG를 통해 데이터베이스 정리를 자동화하는 다른 접근 방식을 권장했습니다. 이 접근 방식은 Cloud Composer 3에서 지원되지 않습니다. 이 DAG는 중복 작업을 실행하므로 이를 삭제하고 데이터베이스 보관 정책으로 대체하여 리소스 사용량을 줄일 수 있습니다.
데이터베이스 크기 제한
시간이 지남에 따라 환경의 Airflow 데이터베이스에는 더 많은 데이터가 저장됩니다. 이 데이터에는 과거 DAG 실행, 태스크, 기타 Airflow 작업과 관련된 정보 및 로그가 포함됩니다.
Airflow 데이터베이스 크기가 20GB를 초과하면 환경을 이후 버전으로 업그레이드할 수 없습니다.
Airflow 데이터베이스 크기가 20GB를 초과하면 스냅샷을 만들 수 없습니다.
데이터베이스 성능 유지
Airflow 데이터베이스 성능 문제로 인해 전체 DAG 실행 문제가 발생할 수 있습니다.
데이터베이스 CPU 및 메모리 사용량 통계를 관찰합니다. CPU 및 메모리 사용률이 한도에 가까워지면 데이터베이스에 과부하가 발생하므로 확장해야 합니다.
Airflow 데이터베이스에 사용할 수 있는 리소스 양은 환경의 환경 크기 속성에 따라 제어됩니다. 데이터베이스를 확장하려면 환경 크기를 더 큰 등급으로 변경하세요. 환경 크기를 늘리면 환경의 비용이 증가합니다.
XCom 메커니즘을 사용하여 파일을 전송하는 경우 Airflow 가이드라인에 따라 사용해야 합니다.
XCom을 사용하여 큰 파일이나 다수의 파일을 전송하면 Airflow 데이터베이스 성능이 영향을 받고 스냅샷을 로드하거나 환경을 업그레이드할 때 오류가 발생할 수 있습니다. 대용량 데이터를 전송하려면 Cloud Storage와 같은 대안을 사용하는 것이 좋습니다.
[[["이해하기 쉬움","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-08-29(UTC)"],[[["\u003cp\u003eThis page outlines how to manually clean up the Airflow database in Cloud Composer 3 environments, as well as automatic alternatives.\u003c/p\u003e\n"],["\u003cp\u003eCloud Composer offers a database retention policy that automatically removes records older than a specified period, and it is preferred over the older database cleanup DAG.\u003c/p\u003e\n"],["\u003cp\u003eExceeding a 20 GB database size in Airflow prevents environment upgrades and snapshot creation, making regular cleanup essential.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud composer environments run\u003c/code\u003e command can be used to manually trim the database, removing entries older than the specified retention period.\u003c/p\u003e\n"],["\u003cp\u003eDatabase performance issues can cause DAG execution problems, and scaling up the environment size can address these issues, while also using proper Xcom practices to avoid issues with the database.\u003c/p\u003e\n"]]],[],null,["\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n**Cloud Composer 3** \\| [Cloud Composer 2](/composer/docs/composer-2/cleanup-airflow-database \"View this page for Cloud Composer 2\") \\| [Cloud Composer 1](/composer/docs/composer-1/cleanup-airflow-database \"View this page for Cloud Composer 1\")\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThis page explains how to maintain the Airflow database in your environment.\n\nAutomatic database cleanup with a database retention policy\n\nYou can configure automatic database cleanup for your Cloud Composer 3\nenvironment by setting a database retention policy. After you set up this\npolicy, records older than a certain period are automatically removed from the\nAirflow database daily. For more information, see\n[Configure database retention policy](/composer/docs/composer-3/configure-db-retention).\n\nDeprecated cleanup procedures **Deprecated:** The **maintenance DAG approach is obsolete** in Cloud Composer 3. If you still use the database maintenance DAG, we recommend to remove or pause it and configure a [database retention policy](/composer/docs/composer-3/configure-db-retention) instead.\n\nBefore the database retention policy became available in\nCloud Composer, we recommended a different approach for automating\nthe database cleanup, through a [database cleanup DAG](/composer/docs/composer-2/cleanup-airflow-database). This\napproach is obsolete in Cloud Composer 3. This DAG does redundant work and you\ncan reduce the resource consumption by removing it and replacing it with a\n[database retention policy](/composer/docs/composer-3/configure-db-retention).\n\nLimits for database size\n\nAs the time goes, the Airflow database of your environment stores more and\nmore data. This data includes information and logs related to past DAG runs,\ntasks, and other Airflow operations.\n\n- If the Airflow database size is more than\n 20 GB,\n then you can't upgrade your environment to a later version.\n\n- If the Airflow database size is more than 20 GB,\n it is not possible to create snapshots.\n\nMaintain database performance\n\n- Airflow database performance issues can lead to overall DAG execution\n issues.\n [Observe Database CPU and memory usage](/composer/docs/composer-3/use-monitoring-dashboard#db-statistics)\n statistics. If CPU and memory utilization approaches the limits, then the\n database is overloaded and requires scaling.\n\n The amount of resources available to the Airflow database is controlled by\n the environment size property of your environment. To scale the database up\n [change the environment size](/composer/docs/composer-3/scale-environments) to a larger tier. Increasing the\n environment size increases the costs of your environment.\n\n- If you use the XCom mechanism to transfer files, make sure that you\n [use it according to Airflow's guidelines](https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/xcoms.html#object-storage-xcom-backend).\n Transferring big files or a large number of files using XCom impacts\n Airflow database's performance and can lead to failures when loading\n snapshots or upgrading your environment. Consider using alternatives such\n as Cloud Storage to transfer large volumes of data.\n\nRemove entries for unused DAGs\n\nYou can remove database entries for unused DAGs by\n[removing DAGs from the Airflow UI](/composer/docs/composer-3/manage-dags#delete-md).\n\nWhat's next\n\n- [Configure database retention policy](/composer/docs/composer-3/configure-db-retention)\n- [Access Airflow command-line interface](/composer/docs/composer-3/access-airflow-cli)"]]