Replies: 4 comments 13 replies
-
|
Thanks for opening your first issue here! Be sure to follow the issue template! |
Beta Was this translation helpful? Give feedback.
-
|
Would it be possible to to wrap it with py-spy, so we can determine what's being slow? e.g. |
Beta Was this translation helpful? Give feedback.
-
|
Python is inherently a bit slow to start up so don't expect any magic. Airflow though is a bit of an extra bad case though since it imports so many other modules. If you use the Docker image it is even slower (assume you do since using K8), because
|
Beta Was this translation helpful? Give feedback.
-
This is explained in the docs:
Alongside the documentation how to disable this check: But you gave me thought that we can only run it for specific commands - so if you run airflow commands as "separate container" commands, this might help a bit.
This is deliberate decision and baking in .pyc files is bad idea as it increases the size of the image significantly (you are basically trading of the size of the image, network, and storage with first time start for some commands. If you want to run airflow commands repetitively, rather than running new container every time, run a single comtainer and @Wats0ns : Airlfow version SHOULD be fast (also in terms of .pyc) because it imports very little, so I also second @jedcunningham here - py-spy would be useful. I just checked my "airflow version" and I looked where the slowness might come from. Almost for sure those are your local_settings or your log configuration. Parsing settings.py (and local settings) and establishing logging configuration is the one thing that happens in So please - run tha py-spy and let us know here by posting it (or mostl likely you will find where it comes from in your configuration). I am converting this one into a discussion, until we hear more about the py-spy results as this is likely not an airflow issue/ |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Apache Airflow version
2.2.2
What happened
Typing any command using airflow, like
airflow,airflow versionis very slow in our production environment (~20-30s for anairflow version), which is not the cas in our dev env. Airflow is run in a docker image based on theapache/airflow:latest-python3.8image in both env. We use the helm packageairflow-stable https://airflow-helm.github.io/chartsto run airflow in prod, bu as stated previously it is very slow when executing commands in a pod.We believe that this may be the one of the cause of another problem we have, which is task unable to start because of max task nb reached.
What you expected to happen
airflow versionshould be immediateHow to reproduce
No response
Operating System
apache/airflow:latest-python3.8, Debian GNU/Linux 10 (buster)
Versions of Apache Airflow Providers
No response
Deployment
Official Apache Airflow Helm Chart
Deployment details
No response
Anything else
No response
Are you willing to submit PR?
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions