karmada-io / karmada

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
https://karmada.io
Apache License 2.0
4.47k stars 884 forks source link

Enhance the scheduling performance of karmada-schduler #5202

Open LivingCcj opened 3 months ago

LivingCcj commented 3 months ago

When karmada-scheduler schedules the rb object for the first time, it would respectively calculate the number of available replicas in the subcluster in the Select phase and the AssignReplica phase. The picture below records metric of karmada_scheduler_scheduling_algorithm_duration_seconds_bucket. image

there could be optimized to once calculate, The result calculated in the Select phase could be directly repeated in the AssignReplica phase. In order to improve the qps of the karmada-scheduler [](url)

chaosi-zju commented 3 months ago

Since the time interval between the selectClusters step and assignReplicas step is only 20 milliseconds, it does seem unnecessary to calculate availableReplicas twice. So, I also think that the second calculation can be omitted.

Hi @Garrybest ,what is your opinion?