goharbor / acceleration-service

Provides a general service to support image acceleration based on kinds of accelerator like Nydus and eStargz etc.
Apache License 2.0
74 stars 26 forks source link

feat: add leaseCache to change gc policy #172

Closed Desiki-high closed 1 year ago

Desiki-high commented 1 year ago

Change GC policy

This patch changes GC policy from LRU to LFU/LRU: cleans the blob by LFU first then LRU.

Change:

⚠️Notice: The leaseCache is not thread-safe, we make sure the safe by the gcSingleflight and the thread-safe of content.db.Update.

Ref: https://github.com/goharbor/acceleration-service/issues/141

Test result of leaseCache: