2

I have a Django app served by Gunicorn. I want to add WebSocket notifications to it, using PostgreSQL as the message queue and either gevent-socketio or tornadio as the WebSocket server.

Can I use the same Gunicorn process to serve WebSockets? Or, rather, do I need another process running gevent's SocketIOServer or tornadio's SocketServer?

Dor
  • 902
  • 4
  • 24

1 Answers1

0

Yes you can for example use gevent-socketio with Django and have only one process running for all requests. Per default the socket-io requests go to /socket.io/ - you could even use the same urls for socketio-requests as well as for others, but it makes sense to keep them in a sub-path (eg. for proxy configurations).

But nonetheless it might make sense to have a seperate process for serving normal HTTP requests (eg. some easy load-balancing etc...).

Bernhard Vallant
  • 49,468
  • 20
  • 120
  • 148