alibaba / alibaba/Sentinel

QPS is blocked when it reaches the threshold??

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

Description

## 环境说明

应用网关:zuul 单机

sentinel 版本:1.6.3

zuul adaptor 版本:1.6.3

数据源Zookeeper

规则数据如下:每秒针对uid限制允许访问数量8

```json
[
{
"id" : 5,
"controlBehavior" : 0,
"resource" : "sop",
"intervalUnit" : 0,
"count" : 8,
"interval" : 1,
"gmtCreate" : 1568252327724,
"gmtModified" : 1568253506932,
"app" : "mg-zuul-test",
"ip" : "10.46.235.124",
"paramItem" : {
"fieldName" : "uid",
"parseStrategy" : 2
},
"burst" : 0,
"resourceMode" : 0,
"grade" : 1,
"port" : 8721
}
]
```

## 问题描述

观察到单位时间流量通过的是3,拒绝的是1,但是我配置的针对header uid限流的阈值是8,总流量都没有达到特定限流的值,为什么就被拦截了?,如下图

![](https://oscimg.oschina.net/oscnet/a54f928084d4d14c61ea77e2255250935b0.jpg)

对应时间Metrics.log

```
1568253804000|2019-09-12 10:03:24|sop|3|1|3|0|106|0|0|3
1568253804000|2019-09-12 10:03:24|__total_inbound_traffic__|3|1|3|0|106|0|0|0
```

原先有出现类似问题,在另一个[issue1002](https://github.com/alibaba/Sentinel/issues/1002)里面

由于这个问题我们一直不敢在生产环境使用sentinel,请教下可能是啥原因

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the linked issue1002 and the reported Sentinel 1.6.3 Zuul adaptor behavior, using the supplied rule JSON and Metrics.log output as the reproduction clues. Determine why requests are rejected below the per-uid threshold, then document a reproducible cause or confirm the behavior is corrected.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.