mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 12:31:07 +01:00
lib/workingsetcache: switch from split cache to full cache after the cache size exceeds 95% of split capacity
Previously the switch occurred when the cache size becomes 100% of its capacity. The cache size could never reach 100% capacity. This could prevent from switching from the split cache to full cache, thus reducing the cache effectiveness.
This commit is contained in:
parent
f4e81aef7e
commit
4ba3fd9e6d
@ -153,7 +153,7 @@ func (c *Cache) cacheSizeWatcher() {
|
||||
var cs fastcache.Stats
|
||||
curr := c.curr.Load().(*fastcache.Cache)
|
||||
curr.UpdateStats(&cs)
|
||||
if cs.BytesSize >= uint64(c.maxBytes)/2 {
|
||||
if cs.BytesSize >= uint64(0.95*float64(c.maxBytes)/2) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user