You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Scheduler is spending most of its time in clear_not_launched_queued_tasks function #34877
Airflow running the clear_not_launched_queued_tasks function on a certain frequency (default 30 seconds). When we run the airflow on a large Kube cluster (pods more than > 5K). Internally the clear_not_launched_queued_tasks function loops through each queued task and checks the corresponding worker pod existence in the Kube cluster. Right this existence check using list pods Kube API. The API is taking more than 1s. if there are 120 queued tasks, then it will take ~ 120 seconds (1s * 120). So, this leads the scheduler to spend most of its time in this function rather than scheduling the tasks. It leads to none of the jobs being scheduled or degraded scheduler performance.
What you think should happen instead
It would be nice to get all the airflow worker pods in a one/few batch calls rather than for each task. These batch calls helps to speed the processing of clear_not_launched_queued_tasks function call.
How to reproduce
Run the airflow on large Kube clusters (> 5K pods). Simulate the airflow to run the 100 parallel DAG runs for every minute.
Activity
dirrao commentedon Oct 13, 2023
@ROVAN1220
Thanks for the inputs.
I am working on the MR to address the performance issue.
mattp- commentedon Oct 13, 2023
@dirrao I think that may be a chatgpt AI comment lol
eladkal commentedon Oct 15, 2023
This is interesting.
I believe this is the K8s equivalent for #8854 ?
cc @jedcunningham @ephraimbuddy
dirrao commentedon Oct 16, 2023
@eladkal They are related. Its more close to #7542