nginx 上游和fail_timeout

Dar*_*rio 4 nginx

nginx 官方文档中的定义fail_timeout如下:

* the time during which the specified number of unsuccessful attempts to communicate with the server should happen to consider the server unavailable;
* and the period of time the server will be considered unavailable.
Run Code Online (Sandbox Code Playgroud)

我的问题是,单个请求的超时时间是多少,之后该请求被标记为不成功,该超时值是如何定义的?

如果max_fails=3fail_timeout=120,这是否意味着请求在 120/3 秒后超时,则不成功?

Oli*_*ver 5

max_fails参数的文档中说明了您要查找的内容:

什么被认为是不成功的尝试由 proxy_next_upstream、fastcgi_next_upstream、uwsgi_next_upstream、scgi_next_upstream 和 memcached_next_upstream 指令定义。

如果您继续阅读这些文档,您会发现可能发生不同的超时:*_connect_timeout*_send_timeout*_read_timeout

因此,不存在适用于单个请求的单一超时,而是根据请求的状态而有不同的超时。和参数仅说明如果fail_timeoutmax_fails给定时间内出现给定数量的故障,则服务器被视为不可用。