Airflow cli response times #68707
-
|
The Airflow cli feels really slow. Is it normal that even the $ time airflow -h
[...]
real 0m8.119s
user 0m7.744s
sys 0m0.270s |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
|
I think the traceback shows something slightly different: it does not necessarily mean that The important part seems to be this: So I would first check whether A quick check could be: airflow config get-value database sql_alchemy_conn
env | grep AIRFLOW__DATABASE__SQL_ALCHEMY_CONNOr, if the CLI crashes too early: python - <<'PY'
import os
print(repr(os.environ.get("AIRFLOW__DATABASE__SQL_ALCHEMY_CONN")))
PYFor a simple local/test setup, you could also try setting it explicitly to a valid SQLite URL just to compare startup behavior: export AIRFLOW__DATABASE__SQL_ALCHEMY_CONN='sqlite:////tmp/airflow.db'
time airflow --helpSo my current guess would be:
|
Beta Was this translation helpful? Give feedback.
-
|
Hi everyone, I looked into this and wanted to share a structured summary since this can be confusing at first glance. What is happening
What to check first
Quick sanity test
Why this still feels slow even when config is valid
Follow-up fix I opened a PR to make this failure mode explicit and actionable instead of cryptic: What that PR does:
If helpful, I can also share a small startup timing matrix (before/after config fix, and across two environments) to separate expected startup overhead from misconfiguration effects. |
Beta Was this translation helpful? Give feedback.
-
|
I'm really sorry for the confusion. I deliberately "voided" the I falsely concluded that the error implies a database connection. But you are correct, it only means, Airflow is reading the config, nothing else. So, I'm back to "Airflow might initializes a lot of things before it looks at what what it's actually supposed to do". Just to have something I can compare to, can someone please run this command and tell me the time? Maybe it's normal? Maybe it's my environment? Maybe it's the container? |
Beta Was this translation helpful? Give feedback.
Thanks for running that comparison. That is a useful baseline.
So the picture seems to be:
and the import profile suggests the time is mostly Python import / Airflow initialization overhead, especially around:
So I think the original conclusion still holds:
airflow --helpdoes not appear to connect to the databaseSQL_ALCHEMY_CONNtraceback was config parsing, not DB connectionairflow --helpstill initializes a non-trivial amount of Airflow…