Given the following minimal example:
# myproject.py
import time
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
time.sleep(5)
return 'hello'
if __name__ == '__main__':
app.run(host='0.0.0.0')
# wsgi.py
from myproject import app
if __name__ == '__main__':
app.run()
uwsgi --http-socket 0.0.0.0:8080 --workers 1 --listen 2 --module wsgi:app
I now expect that sending more than 3 requests (1 ongoing in the worker, 2 queued) at the same time would result in only 3 being served, and the others being rejected.
However, this seems to not be the case. When sending 10 requests like so
curl http://127.0.0.1:8080 & \
curl http://127.0.0.1:8080 & \
curl http://127.0.0.1:8080 & \
curl http://127.0.0.1:8080 & \
curl http://127.0.0.1:8080 & \
curl http://127.0.0.1:8080 & \
curl http://127.0.0.1:8080 & \
curl http://127.0.0.1:8080 & \
curl http://127.0.0.1:8080 & \
curl http://127.0.0.1:8080
all are successfully served one-by-one. Why is this the case? Do I misunderstand/misconfigure something?
(I'm using Ubuntu 20.04, in case this is of any importance.)