istio 限流

#详细参数看官网,我参数就不解释https://istio.io/latest/docs/reference/config/networking/destination-rule/

cat << EOF > dr.yaml 
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: my-test
  namespace: demon
spec:
  host: my-app.demon.svc.cluster.local
  trafficPolicy:
    connectionPool:
      http:
        http2MaxRequests: 10
        maxRequestsPerConnection: 15
    outlierDetection:
      baseEjectionTime: 10s
      consecutive5xxErrors: 10
      interval: 10s
EOF
cat << EOF > demon.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
      - name: my-app
        image: nginx:latest
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: my-app
spec:
  type: NodePort
  selector:
    app: my-app
  ports:
  - name: http
    protocol: TCP
    port: 80
    targetPort: 80
EOF
cat << EOF >  ingress-dr.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: vmmm
spec:
  ingressClassName: nginx
  rules:
  - host: my-app.xxx.top
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: my-app
            port:
              number: 80
EOF
并发工具测试
hey -n 1000 -c 100 -m GET http://my-app.xxxxchangs.top/
# 1000 个并发 GET 请求,总共发送 100 个请求

请添加图片描述

查看日志

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

相关推荐

  1. Redis实现

    2024-02-05 03:46:02       39 阅读
  2. Nginx详解

    2024-02-05 03:46:02       37 阅读
  3. Redisson实现

    2024-02-05 03:46:02       24 阅读
  4. go的

    2024-02-05 03:46:02       17 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-02-05 03:46:02       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-02-05 03:46:02       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-02-05 03:46:02       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-02-05 03:46:02       20 阅读

热门阅读

  1. 51单片机实验课二

    2024-02-05 03:46:02       30 阅读
  2. 类银河恶魔城学习记录1-5 CollisionCheck源代码 P32

    2024-02-05 03:46:02       33 阅读
  3. WorldModels-A3C

    2024-02-05 03:46:02       30 阅读
  4. PHP之EOF定界符

    2024-02-05 03:46:02       32 阅读
  5. 什么是单点登录以及如何实现

    2024-02-05 03:46:02       32 阅读
  6. Group velocity(群速度)

    2024-02-05 03:46:02       35 阅读
  7. 谈谈人生的不确定阶段

    2024-02-05 03:46:02       32 阅读
  8. Ajax-1

    2024-02-05 03:46:02       28 阅读
  9. 平台+低代码:中小企业数字化转型普惠之路

    2024-02-05 03:46:02       38 阅读
  10. 03-OpenFeign-请求传参设置

    2024-02-05 03:46:02       33 阅读
  11. 超全总结!大模型算法岗面试指南来了!

    2024-02-05 03:46:02       34 阅读