-
Notifications
You must be signed in to change notification settings - Fork 604
Support to set QPS and burst by configuration. #3969
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
base: master
Are you sure you want to change the base?
Support to set QPS and burst by configuration. #3969
Conversation
48fef17
to
acedbe9
Compare
CN: 支持通过configuration设置qps和burst. Signed-off-by: KunWuLuan <[email protected]>
acedbe9
to
71e13ae
Compare
Signed-off-by: KunWuLuan <[email protected]>
1da0e31
to
2f7cb92
Compare
@kevin85421 Hi, does the golangci-lint run correctly? I don't think it should modify these files. ![]() ![]() https://github.com/ray-project/kuberay/actions/runs/17038972879/job/48297938933?pr=3969 |
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can open a follow-up PR for helm chart setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM—I can open a PR to add Helm chart settings as a follow-up!
@@ -101,6 +103,8 @@ func main() { | |||
"Use Kubernetes proxy subresource when connecting to the Ray Head node.") | |||
flag.StringVar(&featureGates, "feature-gates", "", "A set of key=value pairs that describe feature gates. E.g. FeatureOne=true,FeatureTwo=false,...") | |||
flag.BoolVar(&enableMetrics, "enable-metrics", false, "Enable the emission of control plane metrics.") | |||
flag.Float64Var(&qps, "qps", float64(configapi.DefaultQPS), "The qps value for the client.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flag.Float64Var(&qps, "qps", float64(configapi.DefaultQPS), "The qps value for the client.") | |
flag.Float64Var(&qps, "qps", float64(configapi.DefaultQPS), "The QPS value for the client communicating with the Kubernetes API server.") |
@@ -101,6 +103,8 @@ func main() { | |||
"Use Kubernetes proxy subresource when connecting to the Ray Head node.") | |||
flag.StringVar(&featureGates, "feature-gates", "", "A set of key=value pairs that describe feature gates. E.g. FeatureOne=true,FeatureTwo=false,...") | |||
flag.BoolVar(&enableMetrics, "enable-metrics", false, "Enable the emission of control plane metrics.") | |||
flag.Float64Var(&qps, "qps", float64(configapi.DefaultQPS), "The qps value for the client.") | |||
flag.IntVar(&burst, "burst", configapi.DefaultBurst, "The burst value for the client.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flag.IntVar(&burst, "burst", configapi.DefaultBurst, "The burst value for the client.") | |
flag.IntVar(&burst, "burst", configapi.DefaultBurst, "The maximum burst for throttling requests from this client to the Kubernetes API server.") |
@@ -101,6 +103,8 @@ func main() { | |||
"Use Kubernetes proxy subresource when connecting to the Ray Head node.") | |||
flag.StringVar(&featureGates, "feature-gates", "", "A set of key=value pairs that describe feature gates. E.g. FeatureOne=true,FeatureTwo=false,...") | |||
flag.BoolVar(&enableMetrics, "enable-metrics", false, "Enable the emission of control plane metrics.") | |||
flag.Float64Var(&qps, "qps", float64(configapi.DefaultQPS), "The qps value for the client.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment linking to https://pkg.go.dev/k8s.io/client-go/rest#Config? It’s not straightforward for readers to understand what “client” refers to.
@@ -10,6 +10,8 @@ const ( | |||
DefaultProbeAddr = ":8082" | |||
DefaultEnableLeaderElection = true | |||
DefaultReconcileConcurrency = 1 | |||
DefaultQPS = float64(100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any rationale behind choosing 100 and 200? They’re 20× the default values—was that intentional?
Can you help me understand the impact from the user’s perspective? For example:
- Experiment 1: 1 goroutine; QPS = 5 and Burst = 10 → X RayCluster CRs become ready in Y1 minutes.
- Experiment 2: 1 goroutine; QPS = 100 and Burst = 200 → X RayCluster CRs become ready in Y2 minutes.
Additionally, Y2 is smaller than Y1.
In addition, what's your KubeRay operator Pod resource configuration? Does it require more CPU / memory?
}, | ||
{ | ||
name: "set QPS and Burst", | ||
configData: `apiVersion: config.ray.io/v1beta1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use v1alpha1 instead to avoid the error?
ray-operator/main_test.go
Outdated
t.Logf("actual config: %v", config) | ||
t.Logf("expected config: %v", testcase.expectedConfig) | ||
t.Error("unexpected config") | ||
if diff := cmp.Diff(config, testcase.expectedConfig, cmpopts.IgnoreFields(configapi.Configuration{}, "QPS", "Burst")); diff != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit hacky. Can we use logic like:
defaults := map[string]any{
MetricsAddr: ...,
QPS: ...,
}
cfg, err := decodeConfig([]byte(testcase.configData), scheme)
if err != nil {
return err
}
if cfg == nil {
cfg = make(map[string]any)
}
for k, v := range defaults {
if _, ok := cfg[k]; !ok {
cfg[k] = v
}
}
# compare cfg and the expected config
Why are these changes needed?
Related issue number
Closes #2367
Checks