kaxil commented on a change in pull request #5743: [AIRFLOW-5088][AIP-24] Persisting serialized DAG in DB for webserver scalability URL: https://github.com/apache/airflow/pull/5743#discussion_r338299167
########## File path: docs/howto/enable-dag-serialization.rst ########## @@ -0,0 +1,109 @@ + .. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + + + + +Enable DAG Serialization +======================== + +Add the following settings in ``airflow.cfg``: + +.. code-block:: ini + + [core] + store_serialized_dags = True + min_serialized_dag_update_interval = 30 + +* ``store_serialized_dags``: This flag decides whether to serialises DAGs and persist them in DB. + If set to True, Webserver reads from DB instead of parsing DAG files +* ``min_serialized_dag_update_interval``: This flag sets the minimum interval (in seconds) after which + the serialized DAG in DB should be updated. This helps in reducing database write rate. + +If you are updating Airflow from <1.10.6, please do not forget to run ``airflow db upgrade``. + + +How it works +------------ + +In order to make Airflow Webserver stateless (almost!), Airflow >=1.10.6 supports +DAG Serialization and DB Persistence. + +.. image:: ../img/dag_serialization.png + +As shown in the image above in Vanilla Airflow, the Webserver and the Scheduler both Review comment: Agree. Updated ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
