在gunicorn中为不同的端点配置不同的超时?

2024-03-29 11:38:50 发布

您现在位置:Python中文网/ 问答频道 /正文

Gunicorn允许配置请求的超时,如下文所示。这似乎是整个应用程序的全局配置。在

是否可以为不同的端点配置不同的超时?可能会覆盖已知需要很长时间的url端点上的默认超时?在

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.


Tags: andofthetoforistimeoutsync