diff --git a/cmd/core/main.go b/cmd/core/main.go index 93edccf08..ad4f05818 100644 --- a/cmd/core/main.go +++ b/cmd/core/main.go @@ -112,6 +112,8 @@ func main() { flag.StringVar(&storageDriver, "storage-driver", "Local", "Application file save to the storage driver") flag.DurationVar(&syncPeriod, "informer-re-sync-interval", 60*time.Minute, "controller shared informer lister full re-sync period") + flag.DurationVar(&commonconfig.ReconcileTimeout, "reconcile-timeout", time.Minute*3, + "the timeout for controller reconcile") flag.StringVar(&oam.SystemDefinitonNamespace, "system-definition-namespace", "vela-system", "define the namespace of the system-level definition") flag.IntVar(&controllerArgs.ConcurrentReconciles, "concurrent-reconciles", 4, "concurrent-reconciles is the concurrent reconcile number of the controller. The default value is 4") flag.Float64Var(&qps, "kube-api-qps", 50, "the qps for reconcile clients. Low qps may lead to low throughput. High qps may give stress to api-server. Raise this value if concurrent-reconciles is set to be high.") diff --git a/design/api/vela-controller-params-reference.md b/design/api/vela-controller-params-reference.md index 5e3c95572..96b743499 100644 --- a/design/api/vela-controller-params-reference.md +++ b/design/api/vela-controller-params-reference.md @@ -22,6 +22,7 @@ | disable-caps | string | "" | To be disabled builtin capability list. | | storage-driver | string | Local | Application file save to the storage driver | | informer-re-sync-interval | time | 1h | Controller shared informer lister full re-sync period, the interval between two routinely reconciles for one CR (like Application) if no changes made to it. | +| reconcile-timeout | time | 3m | The timeout for controller reconcile. | | system-definition-namespace | string | vela-system | define the namespace of the system-level definition | | concurrent-reconciles | int | 4 | The concurrent reconcile number of the controller. You can increase the degree of concurrency if a large number of CPU cores are provided to the controller. | | kube-api-qps | int | 50 | The qps for reconcile k8s clients. Increase it if you have high concurrency. A small number might restrict the requests to the api-server which may cause a long waiting queue when there are a large number of inflight requests. Try to avoid setting it too high since it will cause large burden on apiserver. | @@ -39,4 +40,4 @@ | Medium | < 500 | < 5,000 | < 30,000 | 4 | 500 | 800 | 1 | 2Gi | | Large | < 1,000 | < 12,000 | < 72,000 | 4 | 800 | 1,000 | 2 | 4Gi | -> For details, read KubeVela Performance Test Report \ No newline at end of file +> For details, read KubeVela Performance Test Report diff --git a/pkg/controller/common/context.go b/pkg/controller/common/context.go index ace5b4b05..fab0daa4b 100644 --- a/pkg/controller/common/context.go +++ b/pkg/controller/common/context.go @@ -26,11 +26,12 @@ var ( PerfEnabled = false ) -const ( - reconcileTimeout = time.Minute +var ( + // ReconcileTimeout timeout for controller to reconcile + ReconcileTimeout = time.Minute * 3 ) // NewReconcileContext create context with default timeout (60s) func NewReconcileContext(ctx context.Context) (context.Context, context.CancelFunc) { - return context.WithTimeout(ctx, reconcileTimeout) + return context.WithTimeout(ctx, ReconcileTimeout) }