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.
# spawn a select greenlet
def select_greenlet_runner(fd, event):
"""Sets event when data becomes available to read on fd."""
while True:
event.set()
try:
select([fd], [], [])[0]
except ValueError:
import traceback
print(traceback.format_exc())
break
self._select_greenlet = gevent.spawn(select_greenlet_runner, self._sock, self._event)
In this case, gevent.select() doesn't work, server has to recv the msg after event.wait(timeout=3). If I pass a wait_timeout > 3 to client.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.
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.