We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
这里可以不用作本地缓存,因为Redission 内部的重入本身就是按客户端id+线程id来判断的,这里加了本地缓存,如果业务key很多的话,就可能这里的内存占用会很大
The text was updated successfully, but these errors were encountered:
如果不做缓存,Redission每次去获取锁,都会new Redission Lock对象,对于吞吐量很大的服务,一秒几千上万次调用,那岂不是一秒也要创建出成千上万个对象出来?数据应该都正确的,重入锁应该需要重复利用,缓存起来吧?
Sorry, something went wrong.
参考源码,每次getLock都是new RedissonLock
public class Redisson implements RedissonClient { ... @Override public RLock getLock(String name) { return new RedissonLock(commandExecutor, name); } ... }
No branches or pull requests
这里可以不用作本地缓存,因为Redission 内部的重入本身就是按客户端id+线程id来判断的,这里加了本地缓存,如果业务key很多的话,就可能这里的内存占用会很大
The text was updated successfully, but these errors were encountered: