Server Socket

bind

  • -b ADDRESS, --bind ADDRESS
  • ['127.0.0.1:8000']

The socket to bind.

A string of the form: HOST, HOST:PORT, unix:PATH, fd://FD. An IP is a valid HOST.

Changed in version 20.0: Support for fd://FD got added.

Multiple addresses can be bound. ex.:

  1. $ gunicorn -b 127.0.0.1:8000 -b [::1]:8000 test:app

will bind the test:app application on localhost both on ipv6 and ipv4 interfaces.

backlog

  • --backlog INT
  • 2048

The maximum number of pending connections.

This refers to the number of clients that can be waiting to be served. Exceeding this number results in the client getting an error when attempting to connect. It should only affect servers under significant load.

Must be a positive integer. Generally set in the 64-2048 range.