2017-04-22 57 views
2

我有一个边缘zuul服务器服务哪些路由请求到下游服务春云zuul服务器:非常高的延迟值

予加载测试这种架构400螺纹同时

下游服务总延迟只是1秒。 使用边缘服务器在前置和后置过滤器zuul,我设法计算出延迟时间约为7.5秒平均是大致相同的数字我从hystrix.stream端点我边缘zuul服务器上启用

{ “类型”: “HystrixCommand”, “名” 的 “认证”, “基团”: “RibbonCommand”, “currentTime的”:1492879164747, “isCircuitBreakerOpen”:假, “errorPercentage “:0, “ERRORCOUNT”:0, “requestCount”:500, “rollingCountBadRequests”:0, “rollingCountCollapsedRequests”:0, “rollingCountEmit”:0, “rollingCountExceptionsThrown”:0, “rollingCountFailure”:0, “rollingCountFallbackEmit”:0, “rollingCountFallbackFailure”:0, “rollingCountFallbackMissing”:0, “rollingCountFallbackRejection”:0, “rollingCountFallbackSuccess”:0, “rollingCountResponsesFromCache”:0, “rollingCountSemaphoreRejected”:0, “ rollingCountS hortCircuited “:0, ”rollingCountSuccess“:492, ”rollingCountThreadPoolRejected“:0, ”rollingCountTimeout“:0, ”currentConcurrentExecutionCount“:397, ”rollingMaxConcurrentExecutionCount“:399, ”latencyExecute_mean“:7552, ” latencyExecute “:{ “0”:1003, “25”:8131, “50”:8359, “75”:8543, “90”:9095, “95”:10495, “99”: 12311, “99.5”:12311, “100”:19 551 }, “latencyTotal_mean”:7552, “latencyTotal”:{ “0”:1003, “25”:8131, “50”:8359, “75”:8543, “90 “:9095, ”95“:10495, ”99“:12311, ”99。5" :12311, “100”:19551 }, “propertyValue_circuitBreakerRequestVolumeThreshold”:20, “propertyValue_circuitBreakerSleepWindowInMilliseconds”:5000, “propertyValue_circuitBreakerErrorThresholdPercentage”:50, “propertyValue_circuitBreakerForceOpen”:假, “propertyValue_circuitBreakerForceClosed”:假, “propertyValue_circuitBreakerEnabled”:真实, “propertyValue_executionIsolationStrategy”: “信号量”, “propertyValue_executionIsolationThreadTimeoutInMilliseconds”:200000, “propertyValue_executionTimeoutInMilliseconds”:200000, “的PropertyValue _executionIsolationThreadInterruptOnTimeout “:真实, ”propertyValue_executionIsolationThreadPoolKeyOverride“:空, ”propertyValue_executionIsolationSemaphoreMaxConcurrentRequests“:5000, ”propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests“:10, ”propertyValue_metricsRollingStatisticalWindowInMilliseconds“:10000, ”propertyValue_requestCacheEnabled“:真实, ”propertyValue_requestLogEnabled“:真实, ” reportingHosts “:1, ”的线程池“:” RibbonCommand” }

给定,无论是边缘服务器下游服务是相同的内部网络上,并且所给出的那些属性的值

server.tomcat.max线程= 5000

zuul.host.max每次为route-连接= 5000

zuul.host.max与总连接= 10000

下游服务名称:认证

zuul.eureka.authenticate.semaphore.maxSemaphores = 5000

我设置属性server.tomcat.max线程= 5000在两个边缘服务器和下游服务

为什么延迟是如此之高在边缘服务器?如何消除它,或如何跟踪发生延迟的地方?

我用弹簧引导版本1.4.0.RELEASE建立两个边缘服务器和下游服务

+0

您使用的是哪个版本的spring云? –

+0

布里克斯顿。RELEASE –

回答

0

我猜你的问题可以通过maxTotalConnection和maxPerRoutConnections引起的。如果您在ribbonRoutingFilter中使用zuul,请尝试定义以下属性。

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不影响实际配置。相反,我们应该像上面一样定义ribbon配置。

+0

属性“propertyValue_executionIsolationSemaphoreMaxConcurrentRequests”:5000已根据hystrix.stream输出具有正确的值。 –

+0

我发现这个问题与我们的网络设置有关......网络团队现在负责... thnx为您提供支持。 –