该参数指定了haproxy进行健康检查时的超时时间。默认情况下,如果未设置"timeout check"参数,haproxy将使用"inter"参数作为完整的检查超时时间(包括连接和读取)。在这种情况下,检查请求通常比普通请求更简单和快速处理,因此人们可能希望将该超时时间设置得比"timeout server"参数更小,以便及时剔除响应缓慢的服务器。

然而,如果设置了"timeout check"参数,haproxy将使用"timeout check"的值作为额外的读取超时时间,并使用"min("timeout connect", "inter")"作为连接超时时间。这么做是为了避免那些设置了非常长的"timeout connect"的人在进行健康检查时拖慢检查速度(例如,由于队列或tarpit而需要设置长连接超时时间的情况)。需要注意的是,实际上没有合理的理由设置如此长的连接超时时间,因为可以始终使用"timeout queue"和"timeout tarpit"来避免这种情况。

此参数特定于后端(backend),但可以在"defaults"部分中一次性指定。这实际上是最简单的解决方案,可以避免忘记设置该参数

If set haproxy uses mintimeout connect inter as a connect timeoutfor check and timeout check as an additional read timeout The min isused so that people running with very long timeout connect eg those

原文地址: http://www.cveoy.top/t/topic/iJYV 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录