Replies: 1 comment 4 replies
-
@lgnashold The error is very clear. It indicates that you are taking database objects created in one thread and using them in another. It seems to me you are looking for workarounds instead of actually trying to solve this issue, which is very likely a bug in your application.
To know the answer to this question you have to run a test on both servers using your own application. In matters of performance there are no absolutes, there's lots of variables that influence performance so I cannot give you the answer you hope for. My guess is that there isn't going to be much of a difference, but Gunicorn is probably more robust than eventlet's WSGI server. Another suggestion I can make is that if eventlet is making things complicated for you then you just drop it. These days you can run a WebSocket server using the |
Beta Was this translation helpful? Give feedback.
-
I'm creating a Django web application that also uses python-socketio.
I got the application working with an eventlet WSGI server as in the documentation. I know the traditional django stack is Django + Gunicorn + NGINX. However, I was having difficulties getting Gunicorn to play nice with eventlet and django.
Is there a significant performance benefit to using Gunicorn + eventlet, over just the eventlet WSGI server?**
I continue to receive the same error described
here
almost verbatim, although the solution (--preload) suggested doesn't help. I know this is more likely on Django's end, rather than python-socketio, but if anyone has resolved this issue further that would be appreciated.It's also mentioned in the documentation that with gunicorn, monkey patching might need to be used with the database base drivers. Is there an example on how to do this with Django database drivers?
Finally, in the examples folder, I know there's a django example. This is a big ask, but would it okay if I added a database read or write to this example. Then when testing the various WSGI server options on this example, the interaction with Django's model would also be tested.
Beta Was this translation helpful? Give feedback.
All reactions