fail_timeout官方nginx文档定义如下:
* 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.
我的问题是,请求被标记为不成功的单个请求的超时是多less,以及如何定义这个超时值?
如果max_fails=3和fail_timeout=120 ,这是否意味着如果在120/3秒后超时,请求失败?
在max_fails参数的文档中说明了您正在查找的内容 :
proxy_next_upstream,fastcgi_next_upstream,uwsgi_next_upstream,scgi_next_upstream和memcached_next_upstream指令定义了什么被认为是不成功的尝试。
如果您在这些文档中阅读,您将发现可能发生的不同超时: *_connect_timeout , *_send_timeout , *_read_timeout等
因此,根据请求的状态,没有一个适用于单个请求的超时,而是不同的超时。 fail_timeout和max_fails参数仅仅说明,如果在给定时间内有一定数量的故障,服务器将被视为不可用。