Re: fail_timeout - обсудим ?

Maxim Dounin mdounin на mdounin.ru
Ср Окт 17 13:25:00 UTC 2018


Hello!

On Wed, Oct 17, 2018 at 05:12:31PM +0500, Илья Шипицин wrote:

> привет!
> 
> беру стоковый 1.15.5
> вот такой конфиг
> 
> upstream root-upstream {
>  server 127.0.0.1:999 fail_timeout=30000ms;
> }
> 
> 
> server {
>     listen       80;
>     server_name  localhost;
> 
>         location / {
>                 proxy_pass http://root-upstream;
>         }
> 
> }
> 
> и, собственно, вот
> 
> [root at localhost]# nginx -t
> nginx: [emerg] invalid parameter "fail_timeout=30000ms" in
> /etc/nginx/conf.d/default.conf:2
> nginx: configuration file /etc/nginx/nginx.conf test failed
> [root at localhost]#
> 
> в документации сказано, что так можно

Параметр fail_timeout принимает время в секундах, поэтому так нельзя.

У меня валяется старый патч, меняющий таймауты на миллисекундные, 
но в нём есть вот такой комментарий:

There is a problem: if an error happens and peer->fails (failed,
checked) are set in ngx_http_upstream_free_round_robin_peer(), we
are not guaranteed to see the peer again in a reasonable time.  If
more than 24 days passes, the "now - peer->checked <= peer->fail_timeout"
check in ngx_http_upstream_get_peer() will be incorrect on 32-bit
platforms.

-- 
Maxim Dounin
http://mdounin.ru/


Подробная информация о списке рассылки nginx-ru