2017-04-22 70 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爲您提供支持。 –