mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -153,7 +153,7 @@ func (c *Cache) cacheSizeWatcher() {
|
||||||
var cs fastcache.Stats
|
var cs fastcache.Stats
|
||||||
curr := c.curr.Load().(*fastcache.Cache)
|
curr := c.curr.Load().(*fastcache.Cache)
|
||||||
curr.UpdateStats(&cs)
|
curr.UpdateStats(&cs)
|
||||||
if cs.BytesSize >= uint64(c.maxBytes)/2 {
|
if cs.BytesSize >= uint64(0.95*float64(c.maxBytes)/2) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue