Closed Desiki-high closed 1 year ago
This patch changes GC policy from LRU to LFU/LRU: cleans the blob by LFU first then LRU.
Change:
leaseCache
⚠️Notice: The leaseCache is not thread-safe, we make sure the safe by the gcSingleflight and the thread-safe of content.db.Update.
gcSingleflight
content.db.Update
Ref: https://github.com/goharbor/acceleration-service/issues/141
Test result of leaseCache:
Change GC policy
This patch changes GC policy from LRU to LFU/LRU: cleans the blob by LFU first then LRU.
Change:
leaseCache
: the cache of lease, help record the used count and time.leaseCache
.⚠️Notice: The
leaseCache
is not thread-safe, we make sure the safe by thegcSingleflight
and the thread-safe ofcontent.db.Update
.Ref: https://github.com/goharbor/acceleration-service/issues/141
Test result of leaseCache: