alibaba / alibaba/Sentinel

是否可以通过自定义SlotChainProvider优化内存占用?

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

Description

*feature request*

我们在自己的微服务框架里试用了一下 sentinel,发现会有很多不必要的内存占用。

仿照 dubbo,我们也是以方法粒度定义 resource,但是我们配置的 resource 比较少,所有大量的 slotchain 实际上是没有用的,这是不必要的内存浪费。

所以有一个想法:是否可以在构建slot时(SlotChainProvider)判断是否有对应的 resource rule 配置,如果没有对应的 rule,那么就构建另一个 dummyslotchain,这样可以减少大量不必要的内存占用。

Contributor guide

Open the contributing guide

Research direction

Start with the SlotChainProvider entry point mentioned in the issue and inspect how slot chains are currently built for method-level resources. Trace how resource rules are represented and selected, then define the behavior and memory impact of a dummy slot chain for resources without matching rules. Done means the proposed customization has a clear rule-matching behavior and measurable memory benefit.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.