alibaba / alibaba/Sentinel

When viewing real-time monitoring traffic, it is found that QPS refuses if it does not reach the set threshold.

Open
#1,028 2 comments 0 reactions 0 assignees View on GitHub
area/flow-control kind/question
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## 查看实时监控流量的时候,发现QPS在未达到设置的阈值就拒绝的情况 ##

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

1. 用最新的代码,启动sentinel-dashboard (java -Dserver.port=8088 -jar sentinel-dashboard.jar)。
2. springboot2写的一个简单的hello接口,

```
@Controller
public class HelloController {

@ResponseBody
@RequestMapping("/hello")
@SentinelResource("hello")
public String hello(){
return "HelloWorld";
}
}

application.properties配置:

spring.application.name= MySentinel
server.port= 8080
spring.cloud.sentinel.eager= true
#spring.cloud.sentinel.transport.port=8720
spring.cloud.sentinel.transport.dashboard: 127.0.0.1:8088
spring.cloud.sentinel.transport.heartbeat-interval-ms: 500

```

```
客户端pom.xml引入sentinel:

org.springframework.cloud
spring-cloud-starter-alibaba-sentinel
0.9.0.RELEASE

```

3. dashboard中给hello插入一个接口流控规则。
```

资源名 | 来源应用 | 流控模式 | 阈值类型 | 阈值 | 阈值模式 | 流控效果 |
hello | default | 直接 | QPS | 200 | 单机 | 快速失败

```

3. jmeter单线程来压测这个接口,在流量波动的时候会尔耳出现这种情况。

```
时间 | 通过 QPS | 拒绝QPS | 响应时间(ms)
17:12:55 | 200.0 | 65.0 | 0.0
17:12:54 | 200.0 | 140.0 | 0.0
17:12:53 | 195.0 | 55.0 | 0.0
17:12:52 | 200.0 | 86.0 | 0.0
17:12:51 | 200.0 | 88.0 | 0.0
17:12:50 | 197.0 | 3.0 | 0.0
```

### Tell us your environment
最新的master1.7.0代码
springboot2.1.7.RELEASE写的一个简单的hello接口
org.springframework.cloud:spring-cloud-starter-alibaba-sentinel:0.9.0.RELEASE

### Anything else we need to know?
该问题出现的几率不大,只有在流量波动大的时候才会出现。

Contributor guide

Open the contributing guide

Research direction

Start with the HelloController endpoint and application.properties configuration while running sentinel-dashboard.jar; reproduce the behavior using the QPS 200 rule and the described single-thread JMeter load. Done means determining why requests are rejected below the configured threshold and confirming the expected behavior under fluctuating traffic.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.