alibaba / alibaba/Sentinel

Support LRU evicting mechanism for origin statistic map in StatisticNode

Open
#860 3 comments 0 reactions 0 assignees View on GitHub
good first issue kind/feature
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## Issue Description

Type: feature request

### Describe what happened (or what feature you want)
我们的业务场景,希望能能够按照调用方的IP来限流,Sentinel 目前支持按照调用源来限流,但是没有淘汰策略,业务真正使用起来,假如IP数量比较多,风险有点大,所以希望能够支持LRU,业务使用起来更稳定。

其实热点参数限流,目前是支持LRU的,但是为什么不能用热点参数来限流呢?
热点参数限流,一般情况下,需要把限流的源绑定到参数上,这样才可以使用。但是实际的业务场景很复杂,例如上游服务不愿意改动,所以用热点参数限流可能做起来就不是那么的方便。所以才需要能够按照调用源来限流。例如按IP,这样只需要获取到上游服务的IP就行,并且IP过多的情况下,还支持LRU,就比较稳妥了。

### Describe what you expected to happen

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

1.
2.
3.

### Tell us your environment

### Anything else we need to know?

Contributor guide

Open the contributing guide

Research direction

Start at StatisticNode and inspect how the origin statistic map is maintained. Compare it with the existing LRU support for hot-parameter limiting, then define the bounded eviction behavior for origin-based limiting and verify that callers can use it for high-cardinality sources such as IP addresses.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.