increase auth cache size

Kubernetes-commit: 236112c6af9b22b02e35914fe8fbbdbfe856f975
This commit is contained in:
Daniel Smith 2019-10-08 14:27:28 -07:00 committed by Kubernetes Publisher
parent d01b9c8b1a
commit 344ca1b3a8
1 changed files with 8 additions and 1 deletions

View File

@ -62,7 +62,14 @@ func newWithClock(authenticator authenticator.Token, cacheErrs bool, successTTL,
cacheErrs: cacheErrs,
successTTL: successTTL,
failureTTL: failureTTL,
cache: newStripedCache(32, fnvHashFunc, func() cache { return newSimpleCache(128, clock) }),
// Cache performance degrades noticeably when the number of
// tokens in operation exceeds the size of the cache. It is
// cheap to make the cache big in the second dimension below,
// the memory is only consumed when that many tokens are being
// used. Currently we advertise support 5k nodes and 10k
// namespaces; a 32k entry cache is therefore a 2x safety
// margin.
cache: newStripedCache(32, fnvHashFunc, func() cache { return newSimpleCache(1024, clock) }),
}
}