Pika and Eventlet (Not really an issue of python-socketio) #740
Replies: 5 comments
-
Have you considered not using eventlet? |
Beta Was this translation helpful? Give feedback.
-
Thanks very much for you comment. Yeah, I thought about it. I learnt that gevent is also not compatible with Pika. Is there any good and fast wsgi instead of gevent or eventlet? |
Beta Was this translation helpful? Give feedback.
-
@viviencode I'm not sure how to qualify "good and fast", but Gunicorn with threads is the third main server supported by this package. See the documentation. |
Beta Was this translation helpful? Give feedback.
-
I was using Gunicorn before, I will check about it with thread. But I am afraid that pika is also not thread safe. :\ If I could choose, I would just use pika. Unfortunately I couldn't. I found this https://www.appdynamics.com/blog/engineering/a-performance-analysis-of-python-wsgi-servers-part-2/ for a refer of comparing wsgi. Thank you. |
Beta Was this translation helpful? Give feedback.
-
@viviencode your application is the main contributor towards performance. A slow application running on the fastest WSGI server is still going to perform poorly. I wouldn't worry too much about "fast" WSGI servers. |
Beta Was this translation helpful? Give feedback.
-
Hello.
Recently I met a problem when using multiple Python socket servers. I set up a redis
server as a client manager.
And I also use Eventlet as wsgi. So I learnt that in this case, monkey patching the Python standard library is normally required to force the message queue package to use coroutine friendly functions and classes.
Unfortunately, at some eventlet handlers of the socket io server, I use Pika to publish messages to queues. And after my research, Pika's BlockingConnection is not compatible with eventlet patching. ;(
I think there is no way to make monkey_patch work with Pika after my experiments.
So I am asking for suggestion by any change there would be a solution.
I am thinking using celery or background work. I don't have a clear solution or plan yet.
Thanks in advance if anyone could provide a hint.
Beta Was this translation helpful? Give feedback.
All reactions