omkar-foss commented on PR #43797:
URL: https://github.com/apache/airflow/pull/43797#issuecomment-2463876083

   Hey @pierrejeambrun, I've one concern on this - if we use sync path funcs, 
the FastAPI requests will run in a threadpool (one request per thread), 
consuming more memory per request and will limit throughput on our new APIs, as 
there's a default limit of 40 threads on the threadpool, please see: 
https://github.com/encode/starlette/issues/1724 (context: AnyIO is now used for 
async IO by Starlette, which in turn is used by FastAPI to handle http 
requests).
   
   So, just a suggestion - instead of changing all the path funcs from async to 
sync, it'll be great if wrap the blocking (sync) function calls inside the path 
funcs to make them async, using `asyncio.to_thread` or 
[asyncify](https://asyncer.tiangolo.com/tutorial/asyncify/) or similar.


-- 
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