liquanzhou opened a new issue, #12610:
URL: https://github.com/apache/apisix/issues/12610

   ### Current Behavior
   
   
   为了实现动态upstream, 配置了两个eureka的ip地址
   <img width="1462" height="666" alt="Image" 
src="https://github.com/user-attachments/assets/c8401174-ae09-4c01-aa3d-099faa177798";
 />
   
   限制了一个eureka节点的访问, 持续请求无问题
   <img width="1340" height="614" alt="Image" 
src="https://github.com/user-attachments/assets/d2d2ab12-1341-448e-9cbd-e4416c0779d3";
 />
   
   如果重载了apisix,就会出现一半请求失败,稳定复现
   <img width="1976" height="1556" alt="Image" 
src="https://github.com/user-attachments/assets/13107d42-8bee-43d2-bc8a-4f92d7ea174b";
 />
   
   
   discovery:
     eureka:
       host:
         - "http://10.250.200.99:8761";
         - "http://10.250.200.98:8761";
       prefix: "/eureka/"
       fetch_interval: 30               # 30s
       weight: 100                      # default weight for node
       timeout:
         connect: 2000                  # 2000ms
         send: 2000                     # 2000ms
         read: 5000                     # 5000ms
   
   看起来受这个参数影响,如果设置抓取时间很短, 重载apisix后,会较快恢复
   fetch_interval: 30
   
   即使重载后,很短暂的几秒请求丢失, 对于nginx这种最重要的流量入口,也是不可接受的,所以希望能优化一下: 
   
   重载或重启时候,一个节点可以连接,一个节点不可用连接,因为两个eureka节点数据一致, 就可以拿到全量动态upstream的服务列表, 
不能因为一个eureka节点连接不上,就导致请求一半失败!
   
   ### Expected Behavior
   
   _No response_
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   1.apisix配置注册中心eureka,两个节点
   discovery:
     eureka:
       host:
         - "http://10.250.200.99:8761";
         - "http://10.250.200.98:8761";
       prefix: "/eureka/"
       fetch_interval: 3               # 30s
       weight: 100                      # default weight for node
       timeout:
         connect: 2000                  # 2000ms
         send: 2000                     # 2000ms
         read: 2000                     # 5000ms
   
   2.在一个eureka节点主机上禁用掉apisix的ip所有请求
   iptables -A INPUT -s 10.250.200.202 -j DROP
   
   3.持续curl请求,正常
   
   4.systemctl reload apisix
   
   5.持续curl请求,请求有一半失败
   
   ### Environment
   
   - APISIX version (run `apisix version`):
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to