Skip to content

Commit fb33b2f

Browse files
committed
increase LRU cache size 8x for authorization webhook
1024 seems absurdly small for any normal deployment. At our 10000 byte entry size limit, this will consume max ~80 MB of memory. More realistic entry sizes are going to be less than a kB.
1 parent 8290c85 commit fb33b2f

File tree

1 file changed

+1
-1
lines changed
  • staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook

1 file changed

+1
-1
lines changed

staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func New(kubeConfigFile string, version string, authorizedTTL, unauthorizedTTL t
9595
func newWithBackoff(subjectAccessReview subjectAccessReviewer, authorizedTTL, unauthorizedTTL, initialBackoff time.Duration) (*WebhookAuthorizer, error) {
9696
return &WebhookAuthorizer{
9797
subjectAccessReview: subjectAccessReview,
98-
responseCache: cache.NewLRUExpireCache(1024),
98+
responseCache: cache.NewLRUExpireCache(8192),
9999
authorizedTTL: authorizedTTL,
100100
unauthorizedTTL: unauthorizedTTL,
101101
initialBackoff: initialBackoff,

0 commit comments

Comments
 (0)