Using granian for flask #291
Replies: 2 comments 1 reply
-
Thus you probably want to increase the blocking ones and leave the other value as per default. Also, the backlog is about TCP connections, so such a large value won't help you. The default value should be enough for the vast majority of use cases (gunicorn has 2048 if I remember correctly) |
Beta Was this translation helpful? Give feedback.
-
the flask services has calls to other internal micro services and also DB calls, so consider I want to handle 1000 - 2000 RPS, does it make sense to increase the blocking threads or does 2048 is enough? the worker count is cpu_count * 2 + 1 and the threads count is worker_count * 2. |
Beta Was this translation helpful? Give feedback.
-
Hi,
When we use granian for flask services, it looks like granian doesnt switch the threads and the flask is only serving one request at a time.
is there something I'm missing here? here is the granian configuration used.
granian.Granian(target="main:app", address="0.0.0.0", interface=granian.server.Interfaces.WSGI, port=4001, log_level=granian.server.LogLevels.debug,
workers=workers,threads = threads, websockets=False ,reload=True,respawn_failed_workers=True,
backlog=100000).serve()
Should I increase the blocking-threads configuration to something greater than 1? is it due to this configuration?
Beta Was this translation helpful? Give feedback.
All reactions