首页 > 解决方案 > 为什么在关闭Eureka的情况下使用Zuul + Ribbon时路由会有延迟?

问题描述

Zuul路由到微服务时,大约需要 5 毫秒,但在第 30秒,它会增加 100 毫秒 + 延迟。

我补充说ribbon.eureka.ServerListRefreshInterval=60000。现在我看到它每分钟刷新一次服务器列表,但延迟仍然在第 30秒发生。

有人可以告诉我第 30秒发生了什么吗?

我的祖尔配置:

spring:
  application:
    name: xxxx
  profiles:
    active: default
  cloud:
    config:
      failFast: true
  security:
    enabled: false
  main:
    banner-mode: 'off'
eureka:
  client:
    enabled: false
    registerWithEureka: false
    fetchRegistry: false
zuul:
  host:
    connect-timeout-millis: 60000  # starting the connection
    socket-timeout-millis: 60000   # monitor the continuous incoming data flow
  sensitiveHeaders: Cookie,Set-Cookie
  ignoredServices: '*'
  routes:
    auth:
      path: /xxx/xx/**
      stripPrefix: false
      #url: http://localhost:9003/
    xx:
      path: /xx/xx/**
      stripPrefix: false
      #url: http://localhost:9002/
hystrix:
  command:
    default:
      execution:
        timeout:
          enabled: false
ribbon:
  ReadTimeout: 60000
  ConnectTimeout: 120000
  eureka:
    enabled: false
  security:
    ignored: /**
  basic:
    enabled: false
  management:
    security:
      enabled: false
xx:
 ribbon:
   eureka:
      enabled: false
   ServerListRefreshInterval: 60000

标签: springspring-bootspring-cloudnetflix-zuul

解决方案


推荐阅读