You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Performance Issue with Redisson Lock Watchdog Mechanism When Handling a Large Number of Locks #6303
I have encountered a performance issue while using Redisson. According to the documentation, Redisson uses a single background thread to periodically scan and renew all held locks. By default, this scan interval is internalLockLeaseTime / 3. However, when the number of locks in the EXPIRATION_RENEWAL_MAP is very large, scanning and renewing all locks with a single thread can become very time-consuming.
The specific issues are as follows:
When the number of locks in the EXPIRATION_RENEWAL_MAP is very large, scanning and renewing all locks with a single thread can lead to performance bottlenecks.
If the scanning and renewal operations take too long, some locks may expire before they can be renewed, leading to unintended lock releases.
I would like to know if Redisson has any built-in mechanisms to address this situation? If not, are there any plans to introduce sharding or parallel processing mechanisms in future versions to improve the efficiency of lock renewal operations?
Expiration tasks are executed in parallel already. Expiration process is executed by a single thread in non blocking way, which might not cause any issue. I found that multiple locks can be renewed at once in a batch, which can improve performance.
Activity
mrniko commentedon Jan 8, 2025
Expiration tasks are executed in parallel already. Expiration process is executed by a single thread in non blocking way, which might not cause any issue. I found that multiple locks can be renewed at once in a batch, which can improve performance.
Feature - lockWatchdogBatchSize setting added
mrniko commentedon Jan 15, 2025
It's done. You can use the
lockWatchdogBatchSizesetting to control amount of locks renewed per watchdog task execution.