Coder Social home page Coder Social logo

Comments (5)

jbergstroem avatar jbergstroem commented on May 9, 2024

Not really a issue - but to answer your question, gunicorn will balance incoming requests for you. Gunicorn is similar to Unicorn (unicorn.bogomips.org) in this regard - so feel free to read there for more info. Perhaps some architecture notes should be added to docs?

from gunicorn.

benoitc avatar benoitc commented on May 9, 2024

Load balancing is done by the OS. You can still use NGINX to load balance between different machine. Or even if you need by launching 2 in instances of gunicorn on same app.

from gunicorn.

davisp avatar davisp commented on May 9, 2024

There's no difference between Unix and TCP sockets here. Each listen() socket gets a connection queue, and accept() just pops a connection from that queue. In gunicorn each worker just pops a new connection from that queue as its able. Its similar to the classic producer/consumer model in that the producer just happens to be managed by the kernel.

The load balancing in nginx is orthogonal to a certain degree. If you're used to doing something like using nginx to proxy to 4-12 mongrels on the same machine, you probably just need nginx to proxy to a single gunicorn instance with 4-12 workers.

from gunicorn.

benoitc avatar benoitc commented on May 9, 2024

think answer have been done, feel free to reopen it if needed.

from gunicorn.

radzhome avatar radzhome commented on May 9, 2024

The only difference I can note between the two is the overhead created by TCP/IP when using ip:port. Ip:port is a bit more flexible as it works on any OS. Unix sockets less portable but faster, everything else is the same. Maybe something can be added to the docs to note the differences.

from gunicorn.

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.