socket.timeout: timed out #2092
Answered
by
miguelgrinberg
huwaizatahir2
asked this question in
Q&A
Replies: 1 comment 3 replies
-
I would suggest you migrate off of eventlet, which is not being well maintained. The |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Bug Description
Recently I have upgraded my
Flask-SocketIO
package from4.3.2
to5.3.4
and I am starting to get frequent timeout errors.Further related upgraded packages.
greenlet==1.0.0 => greenlet==2.0.2
eventlet==0.32.0 => eventlet==0.33.3
Logs
Configurations on code level
✅ Monkey Patching on
manage.py
eventlet.monkey_patch()
✅ Initialization => `socketio = SocketIO()
Supervisor configuration
As mentioned in Flask Socket IO deployment documentation, I used Gunicorn web server for the deployment. As mentioned
it is not possible to use more than one worker process when using this web server
So i instead I created 3 single-worker instances to use multiple worker processes with gunicorn on different ports./home/xiangqi/xiangqi_venv/bin/gunicorn -b 0.0.0.0:5001 --worker-connections 25000 --worker-class eventlet -w 1 manage:app
/home/xiangqi/xiangqi_venv/bin/gunicorn -b 0.0.0.0:5002 --worker-connections 25000 --worker-class eventlet -w 1 manage:app
/home/xiangqi/xiangqi_venv/bin/gunicorn -b 0.0.0.0:5003 --worker-connections 25000 --worker-class eventlet -w 1 manage:app
Additional context
I am thinking of doing 2 things, please do help out and let me know if the direction is right?
socketio.sleep(0)
on handlers I think are time consuming as mentioned by @miguelgrinberg here, although i am doubtul on this since my average response time for maximum time consuming handler is 25.32 msping_timeout to 20
seconds for that matter.Beta Was this translation helpful? Give feedback.
All reactions