luoyuliuyin opened a new pull request, #39484:
URL: https://github.com/apache/airflow/pull/39484

   PR of https://github.com/apache/airflow/issues/39482
   
   When the scheduler send task to celery, if there is only 1 task in the 
current cycle, the task will be sent to the main thread; if there are multiple 
tasks, a thread pool will be created based on the number of CPU cores, and then 
all tasks will be consumed by the thread pool.
   There are some problems with the current implementation. The scheduler 
creates a thread pool every time it schedules, which will bring a very large 
performance overhead. In fact, the thread pool can be reused.
   
![image](https://github.com/apache/airflow/assets/28948186/069fed0f-2140-4779-8901-ebd2af29a415)
   
   When I tested, sometimes it would take almost 4 seconds to consume 32 tasks.
   
![image](https://github.com/apache/airflow/assets/28948186/868b6046-35a0-42ba-a897-167dc42fdcfb)
   
   
   
   If the thread pool is reused, it only takes 10 milliseconds.
   
![image](https://github.com/apache/airflow/assets/28948186/f86839c2-61bb-4a37-ad77-0b1bd3805f2b)
   
![image](https://github.com/apache/airflow/assets/28948186/6ee0f090-6f73-4a13-8059-830074e1d6a2)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to