Skip to content

Airflow Webserver slow to start up #14034

@gdevanla

Description

@gdevanla

Apache Airflow version:
2.0.0

Kubernetes version (if you are using kubernetes) (use kubectl version):

Environment:

  • Cloud provider or hardware configuration:

  • OS (e.g. from /etc/os-release): "18.04.1 LTS (Bionic Beaver)"

  • Kernel (e.g. uname -a): 4.15.0-130-generic SLA bugfix #134-Ubuntu

  • Install tools:

  • Others:

What happened:

I am observing real slow start up time when starting the webserver (compared to startup time from previous versions). With one workers, than start up time is close to 2 minutes.

Some observations, as I look at the logs (attached)

  1. Registering routes seems to take ~25 seconds
  2. Adding security decorators seems to take ~12 seconds

Then, I see this message:

[2021-02-02 06:36:45,875] {security.py:398} DEBUG - Cleaning faulty perms
Running the Gunicorn Server with:
Workers: 1 sync
Host: 0.0.0.0:8080
Timeout: 120
Logfiles: - -
Access Logformat: 
=================================================================            
[2021-02-02 06:36:46,059] {cli_action_loggers.py:84} DEBUG - Calling callbacks: []
[2021-02-02 06:36:46,063] {settings.py:290} DEBUG - Disposing DB connection pool (PID 24448)
[2021-02-02 06:36:46,487] {settings.py:208} DEBUG - Setting up DB connection pool (PID 24684)
[2021-02-02 06:36:46,487] {settings.py:273} DEBUG - settings.prepare_engine_args(): Using pool settings. pool_size=5, max_overflow=10, pool_recycle=1800, pid=24684
  1. After that, the Registering route routines kickin for the second time and the entire process repeats once more.

So, effectively, we are re-running all startup related process twice.

What you expected to happen:

Could be useful if we could speed this up. Helps in iterative development of plugins.

I think I may be missing some timeout value, which is causing the process to recycle in a minute.

How to reproduce it:

airflow_webserver -w 1

As minimally and precisely as possible. Keep in mind we do not have access to your cluster or dags.

If you are using kubernetes, please attempt to recreate the issue using minikube or kind.

Anything else we need to know:

The attached logs has more details on the summary I provided above.

airflow_web_non_debug.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected_version:2.0Issues Reported for 2.0area:webserverWebserver related Issueskind:bugThis is a clearly a bugpriority:mediumBug that should be fixed before next release but would not block a release

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions