Slow startup caused by watch exclusion when --reload-excludes
flag points to a very large folder
#2389
Unanswered
smac89
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I'm here to report an issue I encountered with a framework (
litestar
) which makes use of uvicorn. You can follow the full discussion here. I will just give a tl;dr; belowDescription
When starting the development uvicorn server, the initial startup time takes about 2 minutes. I initially thought this was due to running the project via WSL, and therefore the filesystem virtualization may be the root cause, but I was wrong.
Setup
After much testing, it was discovered that the issue was more isolated, and was related to how uvicorn handles excluded files (
--reload-exclude
flag). In this case, it was instructed to exclude all files inside a virtual environment folder created by poetry.Problem analysis
It seems to me that when uvicorn is instructed to reload on change, and a list of excluded files are passed to it, it starts doing some computationally intensive work during those moments, which causes all other operations to hang. I say this because I ran the program through
strace
and for the last 70-90% of those 2 minutes, no system calls are being made and nothing is printing to the console, which means it's either doing nothing or trying to do "everything". I didn't check system resources to know what the case might be, but I'm willing to bet it was simply crunching away on some algorithm.Anyways, that's all I have for that. I'll do my best to respond to clarifications. Have a nice day 👋🏼
Beta Was this translation helpful? Give feedback.
All reactions