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

热点缓存重建 #57

Open
tiancheng91 opened this issue Mar 18, 2021 · 0 comments
Open

热点缓存重建 #57

tiancheng91 opened this issue Mar 18, 2021 · 0 comments

Comments

@tiancheng91
Copy link
Owner

概率性预先重计算


currentTime - ( timeToCompute * beta * log(rand()) ) > expiry


currentTime 是当前时间戳。

timeToCompute 是重新计算缓存值所花费的时间。

beta 是一个大于 0 的非负数,默认值为 1,是可配置的。

rand()是一个返回 0 到 1 之间随机数的函数。

expiry 是缓存值未来被设置为过期的时间戳。


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

1 participant