alibaba / Sentinel

A powerful flow control component enabling reliability, resilience and monitoring for microservices. (面向云原生微服务的高可用流控防护组件)
https://sentinelguard.io/
Apache License 2.0
22.41k stars 8.03k forks source link

nacos配置系统规则后,限流不生效 #1634

Open patience00 opened 4 years ago

patience00 commented 4 years ago

Issue Description

Type: bug report or feature request

Describe what happened (or what feature you want)

nacos配置规则同步到sentinel dashboard 并未生效

Describe what you expected to happen

系统规则生效,限流 成功

How to reproduce it (as minimally and precisely as possible)

  1. 在nacos配置界面修改系统规则: image [ { "highestSystemLoad": -1, "avgRt": -1, "maxThread": -1, "qps": 30 } ]
  2. sentinel dashboard能看到规则已变化,但是限流并未生效
  3. jmeter模拟100个线程,全部成功

Tell us your environment

  <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
                <version>2.1.2.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
                <version>2.1.2.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
                <version>2.1.2.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.csp</groupId>
                <artifactId>sentinel-datasource-nacos</artifactId>
                <version>1.7.2</version>
            </dependency>

Anything else we need to know?

sczyh30 commented 4 years ago

You may inspect the logs according to https://github.com/alibaba/Sentinel/wiki/Logs

sczyh30 commented 4 years ago

Hi, any feedback?

patience00 commented 4 years ago

日志没有看出什么异常. 2020-07-28 22:22:14.535 INFO [DynamicSentinelProperty] Config will be updated to: [SystemRule{highestSystemLoad=-1.0, highestCpuUsage=-1.0, qps=20.0, avgRt=-1, maxThread=-1}] 2020-07-28 22:22:14.535 INFO [SystemRuleManager] Current system check status: true, highestSystemLoad: 1.797693e+308, highestCpuUsage: 1.797693e+308, maxRt: 9223372036854775807, maxThread: 9223372036854775807, maxQps: 2.000000e+01

sczyh30 commented 4 years ago

发一下测试的 metric 日志瞅瞅:~/logs/csp/xxx-metrics.log

patience00 commented 4 years ago

1595946084000|2020-07-28 22:21:24|/registry/machine|1|0|1|0|78|0 1595946084000|2020-07-28 22:21:24|total_inbound_traffic|1|0|1|0|78|0 1595946088000|2020-07-28 22:21:28|/app/scripts/controllers/machine.js|1|0|1|0|10|0 1595946088000|2020-07-28 22:21:28|/app/views/machine.html|1|0|1|0|4|0 1595946088000|2020-07-28 22:21:28|total_inbound_traffic|2|0|2|0|7|0 1595946093000|2020-07-28 22:21:33|/auth/login|1|0|1|0|11|0 1595946093000|2020-07-28 22:21:33|/app/briefinfos.json|1|0|1|0|10|0 1595946093000|2020-07-28 22:21:33|total_inbound_traffic|2|0|2|0|10|0 1595946094000|2020-07-28 22:21:34|/registry/machine|1|0|1|0|2|0 1595946094000|2020-07-28 22:21:34|total_inbound_traffic|1|0|1|0|2|0 1595946096000|2020-07-28 22:21:36|/system/rules.json|1|0|1|0|90|0 1595946096000|2020-07-28 22:21:36|/app/gaia-rest-saas/machines.json|1|0|1|0|8|0 1595946096000|2020-07-28 22:21:36|total_inbound_traffic|2|0|2|0|49|0 1595946098000|2020-07-28 22:21:38|/paramFlow/rules|1|0|1|0|22|0 1595946098000|2020-07-28 22:21:38|/app/gaia-rest-saas/machines.json|1|0|1|0|2|0 1595946098000|2020-07-28 22:21:38|total_inbound_traffic|2|0|2|0|12|0 1595946104000|2020-07-28 22:21:44|/registry/machine|1|0|1|0|2|0 1595946104000|2020-07-28 22:21:44|total_inbound_traffic|1|0|1|0|2|0 1595946114000|2020-07-28 22:21:54|/registry/machine|1|0|1|0|2|0 1595946114000|2020-07-28 22:21:54|total_inbound_traffic|1|0|1|0|2|0 1595946115000|2020-07-28 22:21:55|/app/gaia-rest-saas/machines.json|1|0|1|0|4|0 1595946115000|2020-07-28 22:21:55|/favicon.ico|1|0|1|0|8|0 1595946115000|2020-07-28 22:21:55|/app/briefinfos.json|1|0|1|0|2|0 1595946115000|2020-07-28 22:21:55|/|1|0|1|0|16|0 1595946115000|2020-07-28 22:21:55|total_inbound_traffic|4|0|4|0|7|0 1595946116000|2020-07-28 22:21:56|/paramFlow/rules|3|0|3|0|3|0 1595946116000|2020-07-28 22:21:56|/app/gaia-rest-saas/machines.json|2|0|2|0|2|0 1595946116000|2020-07-28 22:21:56|/favicon.ico|2|0|2|0|1|0 1595946116000|2020-07-28 22:21:56|/app/briefinfos.json|2|0|2|0|0|0 1595946116000|2020-07-28 22:21:56|/|2|0|2|0|2|0 1595946116000|2020-07-28 22:21:56|total_inbound_traffic|11|0|11|0|2|0 1595946124000|2020-07-28 22:22:04|/registry/machine|1|0|1|0|0|0 1595946124000|2020-07-28 22:22:04|total_inbound_traffic|1|0|1|0|0|0 1595946134000|2020-07-28 22:22:14|/registry/machine|1|0|1|0|2|0 1595946134000|2020-07-28 22:22:14|total_inbound_traffic|1|0|1|0|2|0 1595946136000|2020-07-28 22:22:16|/|1|0|1|0|4|0 1595946136000|2020-07-28 22:22:16|total_inbound_traffic|1|0|1|0|4|0 1595946137000|2020-07-28 22:22:17|/paramFlow/rules|1|0|1|0|4|0 1595946137000|2020-07-28 22:22:17|/app/gaia-rest-saas/machines.json|1|0|1|0|2|0 1595946137000|2020-07-28 22:22:17|/favicon.ico|1|0|1|0|2|0 1595946137000|2020-07-28 22:22:17|/app/briefinfos.json|1|0|1|0|0|0 1595946137000|2020-07-28 22:22:17|total_inbound_traffic|4|0|4|0|2|0 1595946138000|2020-07-28 22:22:18|/system/rules.json|1|0|1|0|4|0 1595946138000|2020-07-28 22:22:18|/app/gaia-rest-saas/machines.json|1|0|1|0|2|0 1595946138000|2020-07-28 22:22:18|total_inbound_traffic|2|0|2|0|3|0 1595946144000|2020-07-28 22:22:24|/registry/machine|1|0|1|0|2|0 1595946144000|2020-07-28 22:22:24|total_inbound_traffic|1|0|1|0|2|0 1595946154000|2020-07-28 22:22:34|/registry/machine|1|0|1|0|2|0 1595946154000|2020-07-28 22:22:34|total_inbound_traffic|1|0|1|0|2|0 1595946164000|2020-07-28 22:22:44|/registry/machine|1|0|1|0|2|0 1595946164000|2020-07-28 22:22:44|total_inbound_traffic|1|0|1|0|2|0 1595946174000|2020-07-28 22:22:54|/registry/machine|1|0|1|0|2|0 1595946174000|2020-07-28 22:22:54|total_inbound_traffic|1|0|1|0|2|0 1595946184000|2020-07-28 22:23:04|/registry/machine|1|0|1|0|2|0 1595946184000|2020-07-28 22:23:04|total_inbound_traffic|1|0|1|0|2|0 1595946194000|2020-07-28 22:23:14|/registry/machine|1|0|1|0|0|0 1595946194000|2020-07-28 22:23:14|total_inbound_traffic|1|0|1|0|0|0

xiehongji commented 4 years ago

兄弟,你的问题解决了吗?怎么解决的?我也遇到了同样的问题,持久化到nacos后,限流的效果就不生效了

patience00 commented 4 years ago

兄弟,你的问题解决了吗?怎么解决的?我也遇到了同样的问题,持久化到nacos后,限流的效果就不生效了

没有呀,可能他们正在定位问题吧0.0

ly-chn commented 1 year ago

通过这个方式解决了: https://blog.csdn.net/xiaoyanhhh/article/details/129423369