Merge pull request #90729 from wojtek-t/reduce_cache_size

Update duration to be kept in watchcache
This commit is contained in:
Kubernetes Prow Robot 2020-05-05 08:59:08 -07:00 committed by GitHub
commit a441f869d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -52,7 +52,9 @@ const (
// initial and resync watch lists to storage.
storageWatchListPageSize = int64(10000)
// defaultBookmarkFrequency defines how frequently watch bookmarks should be send
// in addition to sending a bookmark right before watch deadline
// in addition to sending a bookmark right before watch deadline.
//
// NOTE: Update `eventFreshDuration` when changing this value.
defaultBookmarkFrequency = time.Minute
)

View File

@ -47,7 +47,10 @@ const (
resourceVersionTooHighRetrySeconds = 1
// eventFreshDuration is time duration of events we want to keep.
eventFreshDuration = 5 * time.Minute
// We set it to `defaultBookmarkFrequency` plus epsilon to maximize
// chances that last bookmark was sent within kept history, at the
// same time, minimizing the needed memory usage.
eventFreshDuration = 75 * time.Second
// defaultLowerBoundCapacity is a default value for event cache capacity's lower bound.
// 100 is minimum in NewHeuristicWatchCacheSizes.
@ -55,9 +58,6 @@ const (
defaultLowerBoundCapacity = 100
// defaultUpperBoundCapacity should be able to keep eventFreshDuration of history.
// With the current 102400 value though, it's not enough for leases in 5k-node cluster,
// but that is conscious decision.
// TODO: Validate if the current value is high enough for large scale clusters.
defaultUpperBoundCapacity = 100 * 1024
)