Skip to content

Commit d28dc8e

Browse files
committed
Improve controller performance and startup time
- Reduce controller cache sync polling interval from 5s to 1s for faster startup - Increase default page size to 1000 for faster iteration of objects
1 parent 1a45938 commit d28dc8e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

controllers/custom/custom_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func (c *CustomController) Start(ctx context.Context) error {
170170
func (c *CustomController) WaitForCacheSync(controller cache.Controller) {
171171
for !controller.HasSynced() && controller.LastSyncResourceVersion() == "" {
172172
c.log.Info("waiting for controller to sync")
173-
time.Sleep(time.Second * 5)
173+
time.Sleep(time.Second * 1)
174174
}
175175
c.conditions.SetPodDataStoreSyncStatus(true)
176176

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func main() {
147147
flag.BoolVar(&enableProfiling, "enable-profiling", false,
148148
"Enable runtime profiling for debugging purposes.")
149149
flag.StringVar(&clusterName, "cluster-name", "", "The name of the k8s cluster")
150-
flag.IntVar(&listPageLimit, "page-limit", 100,
150+
flag.IntVar(&listPageLimit, "page-limit", 1000,
151151
"The page size limiting the number of response for list operation to API Server")
152152
flag.StringVar(&outputPath, "log-file", "stderr", "The path to redirect controller logs")
153153
flag.IntVar(&healthCheckTimeout, "health-check-timeout", 28,

0 commit comments

Comments
 (0)