Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make cache size configurable #21870

Merged
merged 1 commit into from Feb 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/integration/integration.go
Expand Up @@ -196,7 +196,7 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
Run(3, wait.NeverStop)

// TODO: Write an integration test for the replication controllers watch.
go replicationcontroller.NewReplicationManager(clientset, controller.NoResyncPeriodFunc, replicationcontroller.BurstReplicas).
go replicationcontroller.NewReplicationManager(clientset, controller.NoResyncPeriodFunc, replicationcontroller.BurstReplicas, 4096).
Run(3, wait.NeverStop)

nodeController := nodecontroller.NewNodeController(nil, clientset, 5*time.Minute, util.NewFakeAlwaysRateLimiter(), util.NewFakeAlwaysRateLimiter(),
Expand Down
3 changes: 2 additions & 1 deletion cmd/kube-controller-manager/app/controllermanager.go
Expand Up @@ -181,6 +181,7 @@ func StartControllers(s *options.CMServer, kubeClient *client.Client, kubeconfig
clientset.NewForConfigOrDie(client.AddUserAgent(kubeconfig, "replication-controller")),
ResyncPeriod(s),
replicationcontroller.BurstReplicas,
s.LookupCacheSizeForRC,
).Run(s.ConcurrentRCSyncs, wait.NeverStop)

if s.TerminatedPodGCThreshold > 0 {
Expand Down Expand Up @@ -285,7 +286,7 @@ func StartControllers(s *options.CMServer, kubeClient *client.Client, kubeconfig

if containsResource(resources, "replicasets") {
glog.Infof("Starting ReplicaSet controller")
go replicaset.NewReplicaSetController(clientset.NewForConfigOrDie(client.AddUserAgent(kubeconfig, "replicaset-controller")), ResyncPeriod(s), replicaset.BurstReplicas).
go replicaset.NewReplicaSetController(clientset.NewForConfigOrDie(client.AddUserAgent(kubeconfig, "replicaset-controller")), ResyncPeriod(s), replicaset.BurstReplicas, s.LookupCacheSizeForRS).
Run(s.ConcurrentRSSyncs, wait.NeverStop)
}
}
Expand Down
4 changes: 4 additions & 0 deletions cmd/kube-controller-manager/app/options/options.go
Expand Up @@ -53,6 +53,8 @@ func NewCMServer() *CMServer {
ConcurrentResourceQuotaSyncs: 5,
ConcurrentDeploymentSyncs: 5,
ConcurrentNamespaceSyncs: 2,
LookupCacheSizeForRC: 4096,
LookupCacheSizeForRS: 4096,
ServiceSyncPeriod: unversioned.Duration{5 * time.Minute},
NodeSyncPeriod: unversioned.Duration{10 * time.Second},
ResourceQuotaSyncPeriod: unversioned.Duration{5 * time.Minute},
Expand Down Expand Up @@ -98,6 +100,8 @@ func (s *CMServer) AddFlags(fs *pflag.FlagSet) {
fs.IntVar(&s.ConcurrentResourceQuotaSyncs, "concurrent-resource-quota-syncs", s.ConcurrentResourceQuotaSyncs, "The number of resource quotas that are allowed to sync concurrently. Larger number = more responsive quota management, but more CPU (and network) load")
fs.IntVar(&s.ConcurrentDeploymentSyncs, "concurrent-deployment-syncs", s.ConcurrentDeploymentSyncs, "The number of deployment objects that are allowed to sync concurrently. Larger number = more responsive deployments, but more CPU (and network) load")
fs.IntVar(&s.ConcurrentNamespaceSyncs, "concurrent-namespace-syncs", s.ConcurrentNamespaceSyncs, "The number of namespace objects that are allowed to sync concurrently. Larger number = more responsive namespace termination, but more CPU (and network) load")
fs.IntVar(&s.LookupCacheSizeForRC, "rc-lookup-cache-size", s.LookupCacheSizeForRC, "The the size of lookup cache for replication controllers. Larger number = more responsive replica management, but more MEM load.")
fs.IntVar(&s.LookupCacheSizeForRS, "rs-lookup-cache-size", s.LookupCacheSizeForRS, "The the size of lookup cache for replicatsets. Larger number = more responsive replica management, but more MEM load.")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename "--rc-lookup-cache-size" as "--replication-controller-lookup-cache-size", and rename "--rs-lookup-cache-size" as "--replicaset-lookup-cache-size", It seems that we don't use abbreviation in flag, for example:

"---concurrent-resource-quota-syncs"
"---concurrent-deployment-syncs"
"---concurrent-replicaset-syncs"

We use "--concurrent_rc_syncs" for compatibility reason, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm - yeah, let's rename it until it's not too late :) thanks for noticing it

fs.DurationVar(&s.ServiceSyncPeriod.Duration, "service-sync-period", s.ServiceSyncPeriod.Duration, "The period for syncing services with their external load balancers")
fs.DurationVar(&s.NodeSyncPeriod.Duration, "node-sync-period", s.NodeSyncPeriod.Duration, ""+
"The period for syncing nodes from cloudprovider. Longer periods will result in "+
Expand Down
4 changes: 2 additions & 2 deletions contrib/mesos/pkg/controllermanager/controllermanager.go
Expand Up @@ -131,7 +131,7 @@ func (s *CMServer) Run(_ []string) error {
endpoints := s.createEndpointController(clientset.NewForConfigOrDie(client.AddUserAgent(kubeconfig, "endpoint-controller")))
go endpoints.Run(s.ConcurrentEndpointSyncs, wait.NeverStop)

go replicationcontroller.NewReplicationManager(clientset.NewForConfigOrDie(client.AddUserAgent(kubeconfig, "replication-controller")), s.resyncPeriod, replicationcontroller.BurstReplicas).
go replicationcontroller.NewReplicationManager(clientset.NewForConfigOrDie(client.AddUserAgent(kubeconfig, "replication-controller")), s.resyncPeriod, replicationcontroller.BurstReplicas, s.LookupCacheSizeForRC).
Run(s.ConcurrentRCSyncs, wait.NeverStop)

if s.TerminatedPodGCThreshold > 0 {
Expand Down Expand Up @@ -238,7 +238,7 @@ func (s *CMServer) Run(_ []string) error {

if containsResource(resources, "replicasets") {
glog.Infof("Starting ReplicaSet controller")
go replicaset.NewReplicaSetController(clientset.NewForConfigOrDie(client.AddUserAgent(kubeconfig, "replicaset-controller")), s.resyncPeriod, replicaset.BurstReplicas).
go replicaset.NewReplicaSetController(clientset.NewForConfigOrDie(client.AddUserAgent(kubeconfig, "replicaset-controller")), s.resyncPeriod, replicaset.BurstReplicas, s.LookupCacheSizeForRS).
Run(s.ConcurrentRSSyncs, wait.NeverStop)
}
}
Expand Down
4 changes: 3 additions & 1 deletion docs/admin/kube-controller-manager.md
Expand Up @@ -98,14 +98,16 @@ kube-controller-manager
--pv-recycler-pod-template-filepath-nfs="": The file path to a pod definition used as a template for NFS persistent volume recycling
--pv-recycler-timeout-increment-hostpath=30: the increment of time added per Gi to ActiveDeadlineSeconds for a HostPath scrubber pod. This is for development and testing only and will not work in a multi-node cluster.
--pvclaimbinder-sync-period=10m0s: The period for syncing persistent volumes and persistent volume claims
--rc-lookup-cache-size=4096: The the size of lookup cache for replication controllers. Larger number = more responsive replica management, but more MEM load.
--resource-quota-sync-period=5m0s: The period for syncing quota usage status in the system
--root-ca-file="": If set, this root certificate authority will be included in service account's token secret. This must be a valid PEM-encoded CA bundle.
--rs-lookup-cache-size=4096: The the size of lookup cache for replicatsets. Larger number = more responsive replica management, but more MEM load.
--service-account-private-key-file="": Filename containing a PEM-encoded private RSA key used to sign service account tokens.
--service-sync-period=5m0s: The period for syncing services with their external load balancers
--terminated-pod-gc-threshold=12500: Number of terminated pods that can exist before the terminated pod garbage collector starts deleting terminated pods. If <= 0, the terminated pod garbage collector is disabled.
```

###### Auto generated by spf13/cobra on 8-Feb-2016
###### Auto generated by spf13/cobra on 24-Feb-2016


<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
Expand Down
2 changes: 2 additions & 0 deletions hack/verify-flags/known-flags.txt
Expand Up @@ -289,6 +289,7 @@ pv-recycler-pod-template-filepath-nfs
pv-recycler-maximum-retry
pv-recycler-timeout-increment-hostpath
pvclaimbinder-sync-period
rc-lookup-cache-size
read-only-port
really-crash-for-testing
reconcile-cidr
Expand All @@ -314,6 +315,7 @@ rkt-path
rkt-stage1-image
root-ca-file
root-dir
rs-lookup-cache-size
run-proxy
runtime-config
runtime-cgroups
Expand Down