Skip to content

[history server]Add cmdline flags to make qps and burst configurable#4821

Open
KunWuLuan wants to merge 2 commits into
ray-project:masterfrom
KunWuLuan:master
Open

[history server]Add cmdline flags to make qps and burst configurable#4821
KunWuLuan wants to merge 2 commits into
ray-project:masterfrom
KunWuLuan:master

Conversation

@KunWuLuan
Copy link
Copy Markdown
Contributor

Why are these changes needed?

Related issue number

fix #4483

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

Comment on lines +40 to +51
type ClientManagerConfig struct {
Kubeconfigs string
UseKubernetesProxy bool
QPS float32
Burst int
}

func NewClientManager(cfg ClientManagerConfig) (*ClientManager, error) {
kubeconfigs := cfg.Kubeconfigs
useKubernetesProxy := cfg.UseKubernetesProxy
qps := cfg.QPS
burst := cfg.Burst
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need Kubeconfigs and UseKubernetesProxy?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UseKubernetesProxy is imported by https://github.com/ray-project/kuberay/pull/4404/changes.

Kubeconfigs is used for attaching live dashboards

Copy link
Copy Markdown
Member

@Future-Outlier Future-Outlier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the PR title by adding history server as a string prefix?

@KunWuLuan KunWuLuan changed the title Add cmdline flags to make qps and burst configurable [history server]Add cmdline flags to make qps and burst configurable May 11, 2026
Comment thread historyserver/cmd/historyserver/main.go Outdated
Comment on lines +33 to +34
flag.Float64Var(&qps, "kube-api-qps", 0, "QPS to use for Kubernetes API client (default 50)")
flag.IntVar(&burst, "kube-api-burst", 0, "Burst to use for Kubernetes API client (default 100)")
Copy link
Copy Markdown
Member

@JiangJiaWei1103 JiangJiaWei1103 May 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
flag.Float64Var(&qps, "kube-api-qps", 0, "QPS to use for Kubernetes API client (default 50)")
flag.IntVar(&burst, "kube-api-burst", 0, "Burst to use for Kubernetes API client (default 100)")
flag.Float64Var(&qps, "kube-api-qps", float64(configapi.DefaultQPS),
"The QPS value for the client communicating with the Kubernetes API server.")
flag.IntVar(&burst, "kube-api-burst", configapi.DefaultBurst,
"The maximum burst for throttling requests from this client to the Kubernetes API server.")

Can we align with ray-operator pattern?

flag.Float64Var(&qps, "qps", float64(configapi.DefaultQPS), "The QPS value for the client communicating with the Kubernetes API server.")
flag.IntVar(&burst, "burst", configapi.DefaultBurst, "The maximum burst for throttling requests from this client to the Kubernetes API server.")

Unless there's a specific reason to be more conservative, I would also suggest sticking with ray-operator defaults.

Comment on lines +52 to +57
if qps <= 0 {
qps = 50
}
if burst <= 0 {
burst = 100
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once we correctly handle defaulting in flags, we can remove this fallback in the constructor.

Comment thread historyserver/cmd/historyserver/main.go
Signed-off-by: KunWuLuan <kunwuluan@gmail.com>
@KunWuLuan KunWuLuan force-pushed the master branch 2 times, most recently from 646710e to 25308b3 Compare May 23, 2026 02:09
…ve flag descriptions

Address PR review comments: use ray-operator aligned defaults (QPS=100,
Burst=200) directly in flag definitions and remove redundant fallback
logic in NewClientManager.

Signed-off-by: KunWuLuan <kunwuluan@gmail.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit aa8e9a3. Configure here.


"github.com/sirupsen/logrus"

configapi "github.com/ray-project/kuberay/ray-operator/apis/config/v1alpha1"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heavy dependency import for two trivial constants

Medium Severity

Importing configapi "github.com/ray-project/kuberay/ray-operator/apis/config/v1alpha1" solely for two constant values (DefaultQPS = float64(100) and DefaultBurst = 200) pulls in heavy transitive dependencies. That package's config_utils.go imports batch scheduler packages (volcano, scheduler-plugins, kai-scheduler, yunikorn), adding sigs.k8s.io/scheduler-plugins and volcano.sh/apis as new indirect dependencies to the historyserver binary. Defining these two trivial constants locally would avoid this dependency bloat entirely.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit aa8e9a3. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[history server] Make K8s client's config options configurable

3 participants