resty-redis-cluster
resty-redis-cluster copied to clipboard
redis_cluster_slot_locks what size to set ?
in the read me file, you set 【lua_shared_dict redis_cluster_slot_locks 100k;】,but how do i hnow 100k is enough,can i enlarge it?How do i to assess the redis_cluster_slot_locks size?
在readme的文件里面设置了【lua_shared_dict redis_cluster_slot_locks 100k;】大小为100k,我不确定这个大小是否足够,我是否能扩大它?我怎么评估它的大小?
There is no need to increase the lock. The lock is only used in initialization stage which prevent large amounts of concurrent request call init slot cache.
There is no need to increase the lock. The lock is only used in initialization stage which prevent large amounts of concurrent request call init slot cache.
i am already get this thanks~ to user ngx.semaphore maybe a better way
local sem, err = slotSema:wait(0.01)
slotSema:post(1)
https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/semaphore.md