Gunicorn allows configuring a timeout for requests, as demonstrated in their documentation below. This seems to be a global configuration for the entire application.
Is it possible to configure different timeouts for different endpoints? Perhaps overriding the default timeout on url endpoints that are known to take a long time?
http://docs.gunicorn.org/en/stable/settings.html#timeout
timeout
-t INT, --timeout INT
30
Workers silent for more than this many seconds are killed and restarted.
Generally set to thirty seconds. Only set this noticeably higher if you’re sure of the repercussions for sync workers. For the non sync workers it just means that the worker process is still communicating and is not tied to the length of time required to handle a single request.
By default, Gunicorn gracefully restarts a worker if hasn't completed any work within the last 30 seconds. If you expect your application to respond quickly to constant incoming flow of requests, try experimenting with a lower timeout configuration.
This log file is located at /var/log/cloudify/rest/gunicorn-access.
Runit. Save this as /etc/sv/[app_name]/run , and make it executable ( chmod u+x /etc/sv/[app_name]/run ). Then run ln -s /etc/sv/[app_name] /etc/service/[app_name] . If runit is installed, Gunicorn should start running automatically as soon as you create the symlink.
There is no easy way to do what you want to do. Probably the best option is to package each endpoint into a separate application, and then launch them with their own separate gunicorn processes / workers with the appropriate timeouts. Then put something like nginx to proxy the endpoints to different gunicorn processes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With