nginx_upstream_check_module
nginx_upstream_check_module copied to clipboard
timeout doesn't work (设置了timeout但是没有生效)
配置文件nginx.conf: upstream cluster {
# simple round-robin
server 172.51.171.12:9900;
server 172.51.171.13:9900;
check interval=10000 rise=1 fall=1 timeout=10;
check_http_send "HEAD /mgr.do?acct=4141141 HTTP/1.0\r\n\r\n";
}
if curl http://172.51.171.12:9900/mgr.do?acct=4141141,it will spend more than 400ms.but this server is still alive. (如果访问 http://172.51.171.12:9900,实际需要600ms,但是查看状态,这个节点仍然是激活的)
curl http://localhost:8899/status?format=json
{"servers": { "total": 2, "generation": 1, "server": [ {"index": 0, "upstream": "cluster", "name": "172.51.171.12:9900", "status": "up", "rise": 6, "fall": 0, "type": "tcp", "port": 0}, {"index": 1, "upstream": "cluster", "name": "172.51.171.13:9900", "status": "up", "rise": 6, "fall": 0, "type": "tcp", "port": 0} ] }}
Question问题: any idea? 我这样设置对吗?应该怎么做?