Git Product home page Git Product logo

Comments (5)

miguelgrinberg avatar miguelgrinberg commented on June 6, 2024 2

The doc update for gevent-websocket is being discused in #1272. I'm taking care of that.

Disabling long-polling allows you to use multiple workers in Gunicorn correct, but it has some disadvantages. And even without the sticky sessions, you still need to use a message queue for the workers to coordinate. I have been thinking about how to explain this in the documentation without making it even more convoluted than it is and at some point I'm going to reorganize the docs to better convey these options in addition to the more traditional ones. I have an issue for this work as well #1239.

from python-socketio.

miguelgrinberg avatar miguelgrinberg commented on June 6, 2024

References to gevent-websocket have been removed.

from python-socketio.

lsapan avatar lsapan commented on June 6, 2024

@miguelgrinberg sorry I know you're still working on #1239, but I'm wondering if you could briefly elaborate on these disadvantages:

Disabling long-polling allows you to use multiple workers in Gunicorn correct, but it has some disadvantages.

I'm currently exploring ways to get more throughput from my socketio servers, and using gunicorn with multiple gevent workers is something I was considering.

Any insight you have would be greatly appreciated!

from python-socketio.

miguelgrinberg avatar miguelgrinberg commented on June 6, 2024

@lsapan I think this is less interesting than it sounds because in reality multiple workers have always been supported.

  • If you want to use long-polling and websocket both: Run multiple single-worker Gunicorns (each on a different port), and put a load balancer such as nginx in front of them with sticky sessions enabled.
  • If you want only websocket: You can run a single Gunicorn process with multiple workers, but clients attempting to connect with long-polling will get errors. This is because the Gunicorn load balancer does not support sticky sessions.

In both cases each instance of Socket.IO must connect to a message queue.

from python-socketio.

lsapan avatar lsapan commented on June 6, 2024

@miguelgrinberg got it, thanks for clarifying! I just wanted to make sure I wasn't missing some unforeseen issue.

Thanks again for such an awesome library! ✨

from python-socketio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.