Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否增加动态step调整,让segment分配的频率更加可控 #16

Open
NotFound9 opened this issue Apr 15, 2020 · 2 comments
Open

Comments

@NotFound9
Copy link

能否增加动态step调整,因为如果一开始对业务调用量无法评估的话,对step设置的过小会导致每次分配的segement使用过快,更新时冲突的概率变大,设置得过大又容易造成segement浪费。如果在增加maxId时记录增加时间lastTimeStamp,在下次增加maxId时,判断当前时间减去lastTimeStamp之间的时间差,如果小于我们设定的时间间隔(例如15分钟),那么我们就增大内存中step变量的值,如果大于就适当减少step变量的值,这样可以让segment分配的频率在我们可控的氛围内,如果可以增加的话,我可以实现这部分代码提PR

@johnsonin
Copy link

美团也想这么搞

@tayueyue
Copy link

我也碰到这样的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants