Gunicorn is not rejecting connections over backlog limit

Viewed 818

In gunicorn app, I need to allow only certain number of connections and reject the rest with error. I have this testing config:

timeout = 60
graceful_timeout = 60
workers = 1
worker_connections = 1
backlog = 1
worker_class = "gevent"
max_requests = 1000
max_requests_jitter = 42
preload_app = True
bind = "0.0.0.0:8080"
loglevel = "debug"
accesslog = "-"  # Send access log to stdout.

which I expected should result in accepting only one connection at a time and rejecting the rest. But when I send multiple requests at once, they are queued and processed one by one. For testing purposes, it takes 10 seconds to process one request to make sure there is one active connection.

Using gunicorn version 19.9.0

0 Answers
Related