Spring Cloud Zuul服务器:非常高的延迟值



我有一个 edge zuul服务器服务路由请求 downstream Services

i加载与400个线程同时

的架构测试。

下游服务中总延迟仅为一个秒。使用 Edge Server上的Zuul过滤器,我设法将延迟计算为 7.5秒平均而言,这大约是我从HyStrix.Stream Endpoint获得的大致相同的图在我的边缘Zuul Server上启用

{"类型":" HyStrixCommand"&quot" name":" authenticate&quot"'group; quot;"当前时间:1492879164747,&quot" iscircuitbreakeropen":false,"&quot" errorcount&quot":0,&quot'requestCount&quot:500,&quot" rollingcountbadrequests":0,&quot" rollingCountCollapsedRequests":0,&quot" rollingCountemit":0,&quot'RollingCountExceptions":0:0,&quot" rollingCountFailure&quot":0,&quot" rollingCountfallbackemit":0,&quot" rollingCountfallbackfailure&quot":0,&quot" rollingCountfallbackmissing&quot":0,&quot" rollingCountfallbackseptive&quot":0,&quot" rollingCountfallbackSuccess":0,&quot" rollingcountrespons fromcache&quot":0,&quot" rollingcountsemaphoreyjected":0,&quot" rollingcountshortcircuited":0,&quot" rollingcountsuccess":492,&quot" rollingCountThreadPoolreded&quot":0,&quot" rollingCountTimeout&quot":0,&quot" CurrentConcurrentExecutionCount":397,&quot" RollingMaxConcurrentExecutionCount":399,&quot" latencyExecute_mean&quot":7552,&quot" LatencyExecute":{&quot" 0&quot:1003,25&quot:8131,&quot" 50:8359,75&quot:8543,90&quot:9095,95&quot:10495,99&quot:12311,99.5&quot:12311,&quot" 100:19551},,&quot'LatencyTotal_Mean&quot:7552 ,&quot" ltencytotal&quot":{&quot" 0&quot:1003,25&quot:8131,&quot" 50:8359,75&quot:8543,90&quot:9095,95&quot:10495,99&quot:12311,99.5&quot:12311,&quot" 100:19551},,&quot" propertyvalue_circuitbreakerrequesterrequestvolumethreshold&quot":20,&quot" propertyvalue_circuitersbreakersleepwindowinmilliseconds":5000,&quot" propertyvalue_circuiterbreakererrorthrorthrorthrorthrorthresholdpercentage&quot":50,&quot" propertyvalue_circuiterbreakerforceopen":false,&quot" propertyvalue_circuiterbreakerforceclosed&quot":false,&quot" propertyvalue_circuitbreakerEnabled&quot":true,&quot" propertyvalue_executionIsolationstrategy":"信号"&quot" propertyvalue_executionIsolationThreadTimeoutinmilliseconds":200000,&quot" propertyvalue_execution time outinmilliseconds":200000," propertyvalue_executionIsolationThreadInterRuptOntimeOut&quot':true," propertyvalue_executionisolationthreadpoolkeyoverride" null,&quot" propertyvalue_executionolationsemaphoremaxConcurrentRequrests":5000,&quot" propertyvalue_fallbackisolationsemaphoremaxconcurrentrequrests&quot":10,&quot" propertyvalue_metricsrollingStatisticwindowinmilliseconds":10000," propertyvalue_requestcacheenabled" true,&quot" propertyvalue_requestlogenabled&quot":true,&quot" reportinghosts":1,&quot" threadpool":" RibbonCommand"}

鉴于 edge Server downstream Service 都在同一内部网络上,并给定这些属性值

server.tomcat.max-threads = 5000

zuul.host.max-per-route-connections = 5000

zuul.host.max-total-connections = 10000

下游服务名称:Authenticate

zuul.eureka.authenticate.semaphore.maxsemaphores = 5000

我在边缘服务器和下游服务

中设置属性服务器。

为什么潜伏期如此之高,例如 Edge Server ?如何消除它或如何追踪潜伏期的发生位置?

我使用Spring Boot版本1.4.0.Release构建边缘服务器和下游服务

我想您的问题可能是由maxtotalConnection和MaxPerRoutConnections引起的。如果您将Zuul与RibbonRoutingFilter一起使用,请尝试定义以下属性。

authenticate:
  ribbon:
    MaxTotalHttpConnections: 5000
    MaxHttpConnectionsPerHost: 10000
    MaxTotalConnections: 5000  # just for using apache http client in camden
    MaxConnectionsPerHost: 10000 # just for using apache http client in camden

当前版本(Brixton,Camden,Dalston(似乎对这些属性有很小的错误。与文档不同,zuul.host.max-per-route-connections,zuul.host.max-total-connections不会影响实际配置。相反,我们应该像上面一样定义功能区配置directlt。

最新更新