diff --git a/storage/local/series.go b/storage/local/series.go index 2e4c2b1f0..4a97c3c5c 100644 --- a/storage/local/series.go +++ b/storage/local/series.go @@ -26,13 +26,6 @@ import ( ) const ( - // chunkDescEvictionFactor is a factor used for chunk.Desc eviction (as opposed - // to evictions of chunks, see method evictOlderThan. A chunk takes about 20x - // more memory than a chunk.Desc. With a chunkDescEvictionFactor of 10, not more - // than a third of the total memory taken by a series will be used for - // chunkDescs. - chunkDescEvictionFactor = 10 - headChunkTimeout = time.Hour // Close head chunk if not touched for that long. ) @@ -283,11 +276,11 @@ func (s *memorySeries) maybeCloseHeadChunk() bool { return false } -// evictChunkDescs evicts chunkDescs if there are chunkDescEvictionFactor times -// more than non-evicted chunks. iOldestNotEvicted is the index within the -// current chunkDescs of the oldest chunk that is not evicted. +// evictChunkDescs evicts chunkDescs if the chunk is evicted. +// iOldestNotEvicted is the index within the current chunkDescs of the oldest +// chunk that is not evicted. func (s *memorySeries) evictChunkDescs(iOldestNotEvicted int) { - lenToKeep := chunkDescEvictionFactor * (len(s.chunkDescs) - iOldestNotEvicted) + lenToKeep := len(s.chunkDescs) - iOldestNotEvicted if lenToKeep < len(s.chunkDescs) { s.savedFirstTime = s.firstTime() lenEvicted := len(s.chunkDescs) - lenToKeep