Comments (9)
@icanfly 这样每次重启取新的workerId应该是为了解决重启时服务器时间发生回拨的问题。
from uid-generator.
@zer0Black 你这个想法没错,但是可能存在workid不够用的情况。
只能调整worker位数了, 默认前面的delta seconds才8.5年,worker nodes如果22bit即使支持420万次 也是徒劳。况且产线的一个发号服务怎么会天天重启,一个月重启一次都嫌多。所以worker nodes必须要降位,worker nodes借3位给delta seconds。 delta seconds就能支持68年,这样worker nodes还能支持52万次。即使发号器集群有20台机器,平均一天重启一遍 也可能支持70年。 这才是一个均衡的思路。
from uid-generator.
单机部署多个实例或多个应用在一台主机上都依赖他生成id 就会出问题吧
from uid-generator.
@zljgit Idworker应该是一个服务集群,一台机器部署一个就没有这样的问题。如果在一台物理机环境下部署docker环境,docker也会有独立的IP和mac,所以我觉得这块问题不大。
from uid-generator.
111
from uid-generator.
是否可以在应用的启动脚本中添加 -Dwork.id
参数,这样也可以避免同一台机器多个应用部署使用问题,也不会有 work.id
增加的情况。
from uid-generator.
这个方案会导致时间回拨产生的ID重复,请考虑如下一种场景:
服务实例关闭,时间回拨,重启服务实例
这时候重启实例,如果workid不变,可能会造成ID重复的问题。
但如果每次重启workid都变,即便时间回拨了,也可通过workid来保证生成生成ID不重复
from uid-generator.
@zer0Black 你这个想法没错,但是可能存在workid不够用的情况。
from uid-generator.
workerId的复用方案建议考虑下。
from uid-generator.
Related Issues (20)
- There is a vulnerability in spring 4.2.5.RELEASE,upgrade recommended
- There is a vulnerability in logback 1.1.3,upgrade recommended
- Synchronized DefaultUidGenerator & ParallelGenerate
- 压测的具体操作方法能麻烦提供一下
- 64位虚机里 CacheLine 填充过长问题 HOT 1
- 中文文档里的sql建表语句执行报错 时间字段需要设置默认值 HOT 1
- 总共没几条sql,建议直接使用jdbc,不要在使用mybatis等框架 HOT 2
- 控制台日志频繁打印 HOT 1
- 请问该项目是不再维护了吗
- A component required a bean of type 'com.github.wujun234.uid.impl.CachedUidGenerator' that could not be found. HOT 1
- 为啥不把delta seconds和worker id换个位置? HOT 1
- AtomicLong.updateAndGet()超级费CPU,并发一多就100% HOT 1
- 这个吞吐量怎么算出来的?
- BufferPaddingExecutor中的lastSecond的疑问
- 报错 UidGenerateExption :java.RuntimeExecption :Rejected take buffer . RingBuffer [bufferize=65536,tail=65536,cursor=65536,paddingThreshold=32768] HOT 5
- 机器 id,最多可支持约 420w 次机器启动 HOT 2
- 时间戳运算代码是不是写错了 HOT 1
- 有没有升级为springboot版的 HOT 1
- No qualifying bean of type 'com.github.wujun234.uid.UidGenerator' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@jakarta.annotation.Resource(shareable=true, lookup="", name="", description="", authenticationType=CONTAINER, type=java.lang.Object.class, mappedName="")}
- 什么时候出个go语言版本的
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uid-generator.