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

这个是怎么算的?例如节点采取用完即弃的WorkerIdAssigner策略, 重启频率为12次/天, 那么配置成{"workerBits":23,"timeBits":31,"seqBits":9}时, 可支持28个节点以整体并发量14400 UID/s的速度持续运行68年. 时间 2的31次方-1 / 86400 / 365 = 68年 #36

Open
lyg123 opened this issue Jun 20, 2019 · 2 comments

Comments

@lyg123
Copy link

lyg123 commented Jun 20, 2019

序号 2的9次方 = 512

workid数 2的23次方 = 8388608

重启次数 68 乘上 365 乘上 12 天 = 297840

应用数 节点 除以 重启次数 = 8388608 / 297840 = 28

并发 28 乘上 512 = 14336

这个算的思路是对的吗?

@yanjingfan
Copy link

6哇,狗子

@ijaychang
Copy link

ijaychang commented Nov 8, 2024

因为节点采取用完即弃的WorkerIdAssigner策略,所以总共可以重启的次数是2的23次方,即8388608。timeBits是31位,(2^31-1)/(3600x24x365) 约是68年。1个节点68年的重启次数是 68x365x12 = 297840,8388608/297840约是28,28的意思就是可支持28个节点68年里每天重启12次。那么每秒可提供的id数量就是 2^9*28=14336

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