mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
Locker: Improve Refresh speed (#13430)
Refresh was doing a linear scan of all locked resources. This was adding up to significant delays in locking on high load systems with long running requests. Add a secondary index for O(log(n)) UID -> resource lookups. Multiple resources are stored in consecutive strings. Bonus fixes: * On multiple Unlock entries unlock the write locks we can. * Fix `expireOldLocks` skipping checks on entry after expiring one. * Return fast on canTakeUnlock/canTakeLock. * Prealloc some places.
This commit is contained in:
@@ -34,7 +34,7 @@ const (
|
||||
lockMaintenanceInterval = 1 * time.Minute
|
||||
|
||||
// Lock validity duration
|
||||
lockValidityDuration = 20 * time.Second
|
||||
lockValidityDuration = 1 * time.Minute
|
||||
)
|
||||
|
||||
// To abstract a node over network.
|
||||
|
||||
Reference in New Issue
Block a user