baidu / baidu/uid-generator

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

Open
#36 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
5.6k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

序号 2的9次方 = 512

workid数 2的23次方 = 8388608

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

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

并发 28 乘上 512 = 14336

这个算的思路是对的吗?

Contributor guide

No contributing guide indexed for this repository

Research direction

Review the WorkerIdAssigner strategy and the workerBits, timeBits, and seqBits configuration described in the issue. Check the assumptions about node reuse, restart frequency, sequence capacity, and time range, then document whether the calculation is valid and explain any corrections needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Documentation
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.