resty-redis-cluster icon indicating copy to clipboard operation
resty-redis-cluster copied to clipboard

redis_cluster_slot_locks what size to set ?

Open Toifyx opened this issue 5 years ago • 2 comments

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,我不确定这个大小是否足够,我是否能扩大它?我怎么评估它的大小?

Toifyx avatar Nov 05 '19 02:11 Toifyx

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.

steve0511 avatar Nov 12 '19 03:11 steve0511

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

Toifyx avatar Nov 12 '19 06:11 Toifyx