GitHub user starkmarkus edited a comment on the discussion: Airflow cli 
response times

8 seconds for `airflow -h` sounds high to me, although the Airflow CLI is not a 
tiny binary and does have noticeable Python and import overhead.

The first thing I would check is whether this is pure Airflow startup time or 
something environment-specific being imported on startup.

A few useful checks would be:

```bash
time python -c "import airflow"
time airflow version
time airflow info
PYTHONPROFILEIMPORTTIME=1 airflow -h 2> importtime.log
```

If `import airflow` is already slow, then it is probably the Python 
environment, installed providers, or import-time side effects. If only the CLI 
is slow, then it may be related to command, plugin, or provider discovery.

Things I would look for are:

- many installed provider packages
- custom plugins
- `airflow_local_settings.py`
- slow imports from something on `PYTHONPATH`
- network or secrets backend access during import
- a very slow container, volume, or filesystem

I would also check whether lazy loading is enabled, especially for providers 
and plugins, because disabling it can make CLI startup much heavier.

So I would not call 8 seconds for help output ideal. I would profile the 
imports first and see whether one provider, plugin, or module is dominating 
startup time.

GitHub link: 
https://github.com/apache/airflow/discussions/68707#discussioncomment-17363623

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to