gpt4 book ai didi

spring-cloud - Spring Cloud Gateway 阻止路由发现请求

转载 作者:行者123 更新时间:2023-12-05 07:22:34 25 4
gpt4 key购买 nike

我正在使用 spring-cloud-starter-gateway 版本 2.1.0.RELEASE 的 Spring Cloud Gateway,我需要了解为什么 Gateway 会阻止执行请求DiscoveryClientRouteDefinitionLocator 进程。

Spring Cloud 版本:Greenwich.RELEASE。

我有两个环境:暂存和生产。

在生产环境中,我们有一个工作网关,对于 /actuator/health 调用有以下延迟:

production gateway

我正在调查为什么这些峰值发生在一个简单的健康调用上,我发现网关有时会阻止任何请求(甚至健康或真正的微服务调用)来执行我所有微服务的发现路由。

我们使用 Consul 作为发现服务器,我试图在我的暂存环境中测试这种延迟(Consul 上的硬件资源更少)。此 block 的影响很明显:

staging gateway

在改进 Consul 硬件资源后,我们不再有尖峰,但延迟仍然不完美(发现所有路由时有小尖峰):

upgraded staging gateway

我要问:为什么Spring Cloud Gateway即使有缓存功能也会阻塞请求?这个进程不应该在后台运行吗?我做错了什么?真的是 Spring Cloud Gateway 的问题吗?

谢谢。

最佳答案

讨论 here以前版本的 Spring Cloud Gateway 使用阻塞发现客户端。

使用比 2.1.5.RELEASE 更新的版本将导致网关更加异步,不会执行很多阻塞请求。

关于spring-cloud - Spring Cloud Gateway 阻止路由发现请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56462270/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com