gunicorn: allow to change the worker class and timeout
By design, gunicorn spawns a master and N workers. The master send regular ping messages to the workers. When a worker is not answering to ping message for TIMEOUT seconds, then the master kill the worker, aborting the current requests.
By default gunicorn is using the "sync" worker which is not suitable for long requests like downloading large log files. In fact the worker will block during the whole duration of the request and won't answer to the gunicorn master ping. After 30 seconds (default timeout) the master will kill the worker, aborting the request.
When using an async worker (like eventlet), the worker can process multiple long running requests at the same time while answering to master pings. In this case, requests are not aborteed after TIMEOUT seconds, allowing to download large log files.
This patch allows to change the worker class and the timeout while keeping the current default (sync worker and a timeout of 30 seconds).
In order to use eventlet, admins should install python3-eventlet, update the configuration and restart lava-server-gunicorn.
Signed-off-by: Rémi Duraffort firstname.lastname@example.org