nginx_upstream_check_module
nginx_upstream_check_module copied to clipboard
counts 不增加
说下问题现象:
通过nginx 转发请求到K8s node, K8s node 80端口使用traefik ingress,测试中发现,rise counts计数到2后,就不再增加,如果服务有异常,检测到down,down accounts也是到2不再增加,且在down的情况下即使服务恢复也无法自动检测到。必须要nginx -s reload或nginx restart后才能重新检测。
为什么计数是2呢,似乎和worker_processes=2有关,如果这个参数设置成4,就是计数到4不再增加。计数不再增加后,不确定之后还会自动进行后端服务health检测。
配置如下: upstream k8scluster{ server 1.7.24.126:80 max_fails=2 weight=1; server 1.7.24.127:80 max_fails=2 weight=1; server 1.7.24.128:80 max_fails=2 weight=1; server 1.7.24.129:80 max_fails=2 weight=1; check interval=5000 rise=3 fall=5 timeout=3000 default_down=false type=tcp; }
@lisa-1234 删除max_fails试下,这是官方的参数,不是nginx_upstream_check_module的参数
我发现一个类似的问题,我的nginx版本是1.16.1 , 起初问题是发现rise counts 不增加,导致heath check 一致状态不对,但是fall count是会正常增加的,我调了一下worker process,发现rise count确实和worker process 相关。我的配置如下:
upstream backend {
ip_hash;
server 1.10.3.97:8080;
server 1.10.3.99:8080;
server 1.10.3.100:8080;
check interval=3000 rise=2 fall=5 timeout=1000;
}
你的意思是,当worker process 是2的时候,rise也必须是2?连个参数数值应该相等?
Regards LisaLv
发件人: chengruo [mailto:[email protected]] 发送时间: 2019年11月25日 16:46 收件人: yaoweibin/nginx_upstream_check_module 抄送: Lv, Lisa; Mention 主题: Re: [yaoweibin/nginx_upstream_check_module] counts 不增加 (#202)
我发现一个类似的问题,我的nginx版本是1.16.1 , 起初问题是发现rise counts 不增加,导致heath check 一致状态不对,但是fall count是会正常增加的,我调了一下worker process,发现rise count确实和worker process 相关。我的配置如下:
upstream backend {
ip_hash;
server 1.10.3.97:8080;
server 1.10.3.99:8080;
server 1.10.3.100:8080;
check interval=3000 rise=2 fall=5 timeout=1000;
}
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/yaoweibin/nginx_upstream_check_module/issues/202?email_source=notifications&email_token=AMDXS2GKETOSMYFHDMKZRA3QVOGEVA5CNFSM4HN7IGW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFBTB5I#issuecomment-558051573, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMDXS2EROPNZPWLOU5CZR6TQVOGEVANCNFSM4HN7IGWQ.
Email Confidentiality and Disclaimer: This email contains confidential information,duplication and distribution is prohibited. It is only for the use of authorized persons. If you receive this email in error, please immediately delete it and notify the sender. If you are not the intended recipient, you must not use or disclose any part of this email. We may monitor all email communication to protect our business. We recommend that you check this email and any attachments for presence of viruses. We accept no responsibility for any virus transmitted by us.
测试结果是和你一开始的场景类似,rise count不增加,只不过我的fall count 正常,刚才测试发现,只要worker process 大于等于rise ,health check 就一切正常,不确定是feature还是bug
感谢感谢,我后续再测试验证下你告诉我的这个信息,有更新再反馈告诉你。
Regards LisaLv
发件人: chengruo [mailto:[email protected]] 发送时间: 2019年11月25日 16:58 收件人: yaoweibin/nginx_upstream_check_module 抄送: Lv, Lisa; Mention 主题: Re: [yaoweibin/nginx_upstream_check_module] counts 不增加 (#202)
测试结果是和你一开始的场景类似,rise count不增加,只不过我的fall count 正常,刚才测试发现,只要worker process 大于等于rise ,health check 就一切正常
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/yaoweibin/nginx_upstream_check_module/issues/202?email_source=notifications&email_token=AMDXS2GPVG4553KC7URJH23QVOHSNA5CNFSM4HN7IGW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFBUDSI#issuecomment-558055881, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMDXS2HGBS253VWUID6PQSDQVOHSNANCNFSM4HN7IGWQ.
Email Confidentiality and Disclaimer: This email contains confidential information,duplication and distribution is prohibited. It is only for the use of authorized persons. If you receive this email in error, please immediately delete it and notify the sender. If you are not the intended recipient, you must not use or disclose any part of this email. We may monitor all email communication to protect our business. We recommend that you check this email and any attachments for presence of viruses. We accept no responsibility for any virus transmitted by us.
当 backend 是 up 时使用 tcp 进行健康检查会有这个问题, 修改 rise = 1 能保证检测到 backend 健康状态.