mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 20:37:12 +01:00
lib/workingsetcache: check more frequently for cache size overflow
This should reduce the probability of cache size limit overflow
This commit is contained in:
parent
4785d04312
commit
29cebb3d95
@ -149,8 +149,6 @@ func (c *Cache) expirationWatcher(expireDuration time.Duration) {
|
||||
prev := c.prev.Load().(*fastcache.Cache)
|
||||
prev.Reset()
|
||||
curr := c.curr.Load().(*fastcache.Cache)
|
||||
var cs fastcache.Stats
|
||||
curr.UpdateStats(&cs)
|
||||
c.prev.Store(curr)
|
||||
// Use c.maxBytes/2 instead of cs.MaxBytesSize for creating new cache,
|
||||
// since cs.MaxBytesSize may not match c.maxBytes/2, so the created cache
|
||||
@ -162,7 +160,7 @@ func (c *Cache) expirationWatcher(expireDuration time.Duration) {
|
||||
}
|
||||
|
||||
func (c *Cache) cacheSizeWatcher() {
|
||||
t := time.NewTicker(time.Minute)
|
||||
t := time.NewTicker(1500 * time.Millisecond)
|
||||
defer t.Stop()
|
||||
|
||||
var maxBytesSize uint64
|
||||
|
Loading…
Reference in New Issue
Block a user