Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1A00F200C49 for ; Fri, 17 Mar 2017 23:04:48 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 18BF8160B92; Fri, 17 Mar 2017 22:04:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6E99C160B70 for ; Fri, 17 Mar 2017 23:04:47 +0100 (CET) Received: (qmail 69837 invoked by uid 500); 17 Mar 2017 22:04:46 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 69824 invoked by uid 99); 17 Mar 2017 22:04:46 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Mar 2017 22:04:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3CD06183A61 for ; Fri, 17 Mar 2017 22:04:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.651 X-Spam-Level: X-Spam-Status: No, score=0.651 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 8JM-kz5deDOW for ; Fri, 17 Mar 2017 22:04:45 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 5720A5F613 for ; Fri, 17 Mar 2017 22:04:45 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 9E410E0AF9 for ; Fri, 17 Mar 2017 22:04:42 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0ED8F254C1 for ; Fri, 17 Mar 2017 22:04:42 +0000 (UTC) Date: Fri, 17 Mar 2017 22:04:42 +0000 (UTC) From: "Jeremiah Lowin (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (AIRFLOW-1005) Speed up Airflow startup time MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 17 Mar 2017 22:04:48 -0000 Jeremiah Lowin created AIRFLOW-1005: --------------------------------------- Summary: 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 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)