nginx_upstream_check_module
                                
                                
                                
                                    nginx_upstream_check_module copied to clipboard
                            
                            
                            
                        Health checks upstreams for nginx
情景是这样的 upstream www.teamtalk.com { server 172.16.63.149:8080; server 172.16.63.167:8080; check interval=3000 rise=1 fall=5 timeout=1000 type=tcp; } 监控的两个服务我只开启第一个 可能我理解的有问题,我认为健康包的发送频率相同的情况下,Rise_count和Fail_count的增长速度应该一样。但事实是,当Rise_count涨到3时,Fail_count已经60了。 如果我只开启第二个 情况也一样Rise_count还是涨的很慢并没有按照interval增长。Fail_count的倒是按照interval增长。 所以我现在很疑惑 Rise_count到底是如何计算的?
TCP检测bug
进行TCP检测时,若后端网线掉或者ip更改后,不会触发down检测,看代码,发现connection一直没有关,也没有进行discard回调。导致模块一直判断后端alive,没有设置为down。 查看代码后,将TCP检测中的keepalive设置为0(代码状态为1),意味着每次都会与upstream建立TCP连接,可以生效!
Does this module support UDP health check?
Before this change upstream health check module reported statuses of all resolved backends ip addresses for the specified fqdn and rendered each backend into a one or more resolved ip...
Current behavior: upstream_check_module send healthcheck and kills the connection to the server once the module has read the HTTP status line (HTTP/1.1 200). However it leads to abnormal errors on...
Read the entire HTTP header instead of closing connection after HTTP status line.
reqstat module 中的 ngx_http_reqstat_input_body_filter , 好像整个tengine 项目没有入口能够进入ngx_http_top_input_body_filter这个filter static ngx_int_t ngx_http_reqstat_init(ngx_conf_t *cf) { ngx_http_handler_pt *h; ngx_http_core_main_conf_t *cmcf; cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module); h = ngx_array_push(&cmcf->phases[NGX_HTTP_LOG_PHASE].handlers); if (h == NULL) { return NGX_ERROR;...
一个请求使用 ngx_http_upstream_check_add_dynamic_peer 成功之后 另一个请求马上使用upstream_check_delelte_dynamic_peer,回删除失败 实验如下 add server=172.31.0.3:18088 remove server=172.31.0.3:18088 应该是并发带来的问题 2018/02/09 15:37:36 [debug] 43320#0: http upstream check add [0], index=0, delete:0 2018/02/09 15:37:36 [debug] 43320#0: http upstream check add [1],...
I using nginx version 1.9.12 and when build have error: src/http/ngx_http_upstream_round_robin.c: In function ‘ngx_http_upstream_free_round_robin_peer’: src/http/ngx_http_upstream_round_robin.c:645: error: label ‘failed’ used but not defined make[1]: **\* [objs/src/http/ngx_http_upstream_round_robin.o] Error 1 make[1]: Leaving directory...
真实环境中,应用是否可以用,是根据应用的业务处理是否正常;如果nginx能从响应头中判断后端应用的健康状态,就可以实现应用的隔离与恢复了!