Feat: add reconcile timeout configuration for vela-core (#2630)

This commit is contained in:
Somefive
2021-11-04 20:48:06 +08:00
committed by GitHub
parent d8007d823d
commit d2672cea48
3 changed files with 8 additions and 4 deletions
+2
View File
@@ -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.")
@@ -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
> For details, read KubeVela Performance Test Report
+4 -3
View File
@@ -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)
}