Hi 最近发现当 tengine 添加了大量 upstream 并配置 upstream check 的情况下,会出现健康检查进程间不同步的现象。 使用版本:2.1.1 现象描述: upstream check 配置
check interval=5000 rise=1 fall=1 timeout=2000 type=http default_down=false;
check_keepalive_requests 100;
check_http_send "GET /someuri HTTP/1.0\r\nConnection:keep-alive\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;
为了方便追踪进程对健康页面的调用情况,我把 checkuri 设为了一个不可访问的地址, 然后发现 error.log 打印出以下内容(为了便于说明问题,我抽取了三个进程号):
2015/11/19 18:32:16 [error] 16768#0: check protocol http error with peer: 10.15.133.33:80
2015/11/19 18:32:21 [error] 16770#0: check protocol http error with peer: 10.15.133.33:80
2015/11/19 18:32:23 [error] 16773#0: check protocol http error with peer: 10.15.133.33:80
2015/11/19 18:32:23 [error] 16768#0: check protocol http error with peer: 10.15.133.33:80
2015/11/19 18:32:26 [error] 16770#0: check protocol http error with peer: 10.15.133.33:80
2015/11/19 18:32:23 [error] 16773#0: check protocol http error with peer: 10.15.133.33:80
按照我的理解, upstream check 的预期行为应该是进程间协调工作对 upstream server 进行健康检查,由于 timeout = 2000,所以这里看到的信息应该是每 7000 ms 出现一个 check protocol http error。 按照现实情况来看,每一个进程单独进行了 upstream check,每隔 7000ms 进行一次健康检查。
这样的话,单个后台服务器的健康检查页面增加了 process_num 的倍。 我们目前还没有找到触发问题的最小测试集,但这个现象出现得还是比较频繁的。
请问 tengine 在压测中有没有出现过类似的问题?或者能否告知可能导致这个现象的原因以便我们排错。