【问题标题】:spring cloud zuul server : very high latency valuespring cloud zuul 服务器:非常高的延迟值
【发布时间】:2017-09-19 14:08:43
【问题描述】:

我有一个 edge zuul 服务器服务,它将请求路由到 下游服务

我同时使用 400 个线程对该架构进行负载测试

下游服务中,总延迟仅为一秒。 在 edge 服务器 上使用 pre 和 post zuul 过滤器,我设法计算出平均延迟约为 7.5 秒,这与我从 hystrix.stream 端点获得的数字大致相同在我的 edge zuul 服务器

上启用

{ "type":"HystrixCommand", “名称”:“认证”, "group":"RibbonCommand", “当前时间”:1492879164747, "isCircuitBreakerOpen":false, “错误百分比”:0, “错误计数”:0, “请求计数”: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, "rollingCountShortCircuited":0, “滚动计数成功”:492, "rollingCountThreadPoolRejected":0, “滚动计数超时”:0, "currentConcurrentExecutionCount":397, "rollingMaxConcurrentExecutionCount":399, “latencyExecute_mean”:7552, “延迟执行”:{ “0”:1003, “25”:8131, “50”:8359, “75”:8543, “90”:9095, “95”:10495, “99”:12311, “99.5”:12311, “100”:19551 }, "latencyTotal_mean":7552, “延迟总”:{ “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":"SEMAPHORE", “propertyValue_executionIsolationThreadTimeoutInMilliseconds”:200000, "propertyValue_executionTimeoutInMilliseconds":200000, “propertyValue_executionIsolationThreadInterruptOnTimeout”:真, "propertyValue_executionIsolationThreadPoolKeyOverride":null, “propertyValue_executionIsolationSemaphoreMaxConcurrentRequests”:5000, “propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests”:10, “propertyValue_metricsRollingStatisticalWindowInMilliseconds”:10000, “propertyValue_requestCacheEnabled”:真, “propertyValue_requestLogEnabled”:真, “报告主机”:1, “线程池”:“功能区命令” }

考虑到边缘服务器下游服务都在同一个内部网络上,并且给定了这些属性值

server.tomcat.max-threads=5000

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

zuul.host.max-total-connections=10000

下游服务名称:认证

zuul.eureka.authenticate.semaphore.maxSemaphores=5000

我在边缘服务器和下游服务中都设置了属性 server.tomcat.max-threads=5000

为什么边缘服务器的延迟如此之高?如何消除它或如何追踪延迟发生的位置?

我使用spring boot 1.4.0.RELEASE版本同时构建边缘服务器和下游服务

【问题讨论】:

  • 你用的是哪个版本的spring cloud?
  • Brixton.RELEASE

标签: spring-boot netflix-zuul hystrix spring-cloud-netflix


【解决方案1】:

我猜你的问题可能是由 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 不影响实际配置。相反,我们应该像上面那样直接定义功能区配置。

【讨论】:

  • 属性 "propertyValue_executionIsolationSemaphoreMaxConcurrentRequests":5000 已经根据 hystrix.stream 输出具有正确的值。
  • 我发现问题与我们的网络设置有关..网络团队现在负责...谢谢您的支持。
猜你喜欢
  • 2015-01-18
  • 2017-11-21
  • 1970-01-01
  • 1970-01-01
  • 2015-10-25
  • 2020-09-18
  • 2020-08-27
  • 2023-02-23
  • 2016-10-11
相关资源
最近更新 更多