You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/03/19 15:21:41 UTC

[jira] [Commented] (AIRFLOW-1005) Speed up Airflow startup time

    [ https://issues.apache.org/jira/browse/AIRFLOW-1005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15931737#comment-15931737 ] 

ASF subversion and git services commented on AIRFLOW-1005:
----------------------------------------------------------

Commit 996dd309331b010b15e34b99222430283ad7d8a4 in incubator-airflow's branch refs/heads/master from [~jlowin]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=996dd30 ]

[AIRFLOW-1005] Improve Airflow startup time

Airflow’s startup time can be reduced by 50% by
deferring imports of Cryptography (and relatedly,
not generating Fernet keys unless we have to) and
Alembic.


> Speed up Airflow startup time
> -----------------------------
>
>                 Key: AIRFLOW-1005
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1005
>             Project: Apache Airflow
>          Issue Type: Improvement
>    Affects Versions: 1.8.0
>            Reporter: Jeremiah Lowin
>            Assignee: Jeremiah Lowin
>            Priority: Minor
>             Fix For: 1.9.0
>
>         Attachments: Screen Shot 2017-03-17 at 6.04.23 PM.png
>
>
> Airflow takes approximately 1 second to import. It turns out that more than half the time is spend doing two things: importing Cryptography to create Fernet keys and importing Alembic. 
> The first Cryptography import is in configuration.py and is only necessary if Airflow is generating a new airflow.cfg file (but currently gets run every time). Therefore it can be easily deferred.
> The second is in models.py to check if encryption is turned on. This can also be deferred until encryption checks are actually needed.
> Alembic is always imported even though it is only needed for running initdb() and upgradedb(). It can be lazily imported inside those functions.
> These simple changes reduce Airflow's startup time by half on my machine.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)