New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OSError: [Errno 24] Too many open files #1030
Comments
the open files is 1024, you should increase it! |
I already tried it. It only increase time to this error. |
Hard to say if this is on our side (there's nothing in the logs that says something about uvicorn or I'm missing something ?). It would be also interesting to check if this happens without ssl enabled. If that does happen only after 24h it's going to be hard to reproduce so please try to come up with a reproducible example that would trigger that without being that long so we can investigate. On my side I tried to reproduce with an app running pretty much like yours |
I see this problem too. Some of my experience:
From what I can tell, some resource is leaking, but I can't point to the specific one. |
what would help is the application or the endpoint your're suspecting that would leak. |
will close this as stale, feel free to reopen if the issue persists |
Hm... It looks like we experienced precisely the same issue. But in our case takes a few days until the service enters into a loop of such error without a recovery.
|
Same here, running uvicorn 0.20.0/FastAPI 0.89.1/Python 3.9 inside a container on ECS. Ran fine for a few days with some occasional load and then errors out.
|
Pardon me, forgot to attach our spec.
|
I sense @AranVinkItility we have something in common. We are running containers on AWS. |
I am having a similar issue. I am just experimenting with
My dependencies (using Poetry):
The docker image causing trouble is Edit: After some further experimentation with open file limits I have managed to make it work, which suggests there is an issue with docker and the local system defining their Setting Docker However, bumping my local user's
|
Same here, [tool.poetry.dependencies] |
Regarding DazEdword and my similar issue it looks like that it is bound to the usage of |
I am facing the same issue as well. 2024-02-14 15:07:08,273 - ERROR - socket.accept() out of system resource What is the solution for this issue ? |
Same issue here. Any update about this? |
Same error here. Any updates? shall we re-open the issue?
S |
I am also facing the same issue. |
socket.accept() out of system resource Hi, |
Checklist
master
.Describe the bug
Server will hit some limit (I don't know what it is) and stop accept any new request.
Looks like Some connection is always alive
To reproduce
Host a server and keep making request on it after around 24H.
Expected behavior
The connection should be close after 60 sec.
Actual behavior
Get
asyncio:socket.accept() out of system resource
andOSError: [Errno 24] Too many open files
error log when try to make new request on server.I already make sure everything or browser is closed. But looks like some connection is still alive.
Debugging material
The
ESTABLISHED
will increase by time.run
lsof
in container:There shows like
500u
or more after server up time for 24hWhen it hit the limit, the server no longer can accept any new request.
docker logs
shows below:I have to
down
andup
the docker container again.And the number will go down to only like
10u
Run
ulimit -a
in container:I already tried increase the open files (-n) 1024.
But it didn't resolve the problem.
Only increase the time to happen this problem.
Environment
Run server by following command:
uvicorn --version
:python --version
:cat /etc/os-release
in container:Important
The text was updated successfully, but these errors were encountered: