-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
gevent_uwsgi connection limit #228
Comments
How did you start uwsgi? What options did you use? |
Run uwsgi like this:
I changed the linux open file limit
|
The test code if you need: import socketio
sio = socketio.Server()
app = socketio.WSGIApp(sio) Clients: from gevent import monkey
monkey.patch_all()
import gevent
import socketio
ALL_USER = 1030
SPAWN_USER = 10
num = 0
for i in range(int(ALL_USER/SPAWN_USER)):
for j in range(SPAWN_USER):
gevent.spawn(socketio.Client().connect(
'http://127.0.0.1:10086', transports=['websocket'], wait_timeout=1))
num += SPAWN_USER
print(num)
gevent.sleep(1)
while True:
gevent.sleep(1) pip requirement.txt
|
This is a question that you need to ask someone familiar with the uWSGI project. As far as I can see your configuration from the Flask-SocketIO side is correct. |
It is not problem about uwsgi. The major problem is |
Okay, sorry, I do understand now. This is very old code that I haven't seen in many years, I thought you were copying code from uWSGI. I have changed the use of select to the |
Yeah, the new code in the main branch fix the problem. The |
Hi, I found if almost more than 1024 clients connect to the server running using gevent_uwsgi, the extra clients will connect failed. After debugging, the below code will raise error since the connection_fd() return a value bigger than 1024.
In this case,
gevent.select()
doesn't work, server has to recv the msg afterevent.wait(timeout=3)
. If I pass a wait_timeout > 3 toclient.connect()
, the client can work, while all the msgs are processed 3s latter.So I wonder if there's a way to advance this scene.
The text was updated successfully, but these errors were encountered: