Istio 16 熔断

Submitted by Lizhe on Thu, 06/25/2020 - 10:54

熔断的概念这里就不提了,主要是为了how而不是why

apiVersion: networking.istio.io/v1alpha3

kind: DestinationRule

metadata:

  name: flaskapp-desrule 

  namespace: lizhe 

spec: 

  host: flaskapp-service

  trafficPolicy:

    connectionPool:

      tcp:

        maxConnections: 1

      http:

        http1MaxPendingRequests: 1

        maxRequestsPerConnection: 1

    outlierDetection:

      consecutiveErrors: 1

      interval: 1s

      baseEjectionTime: 3m

      maxEjectionPercent: 100

    loadBalancer:

      simple: LEAST_CONN

  subsets:

  - name: v1 

    labels: 

      version: v1

  - name: v2

    labels: 

      version: v2

 

 

20200625065038

 

我们把熔断设置改成3 再试一次

20200625065746

 

可以看到这次 线程数3,最大连接数3,没有发生熔断现象了

wrk -c 3 -t 3 http://flaskapp-service/env/version

20200625070149