← Back to Pull requests

sig-scalability: turn contention profiling off in the kube-up scale jobs #38351

Closed
unknown closed this pull request without merging on Nov 25, 2026 13:26 UTC
View on GitHub
unknown unknown commented on Nov 25, 2026 13:10 UTC
Author

The scalability presets and a few job arguments pass --contention-profiling to kube-apiserver, kube-controller-manager and kube-scheduler. The flag sets the Go block profile rate to 1, so the runtime records a stack trace for every blocking event and takes a global lock to store it.

The scale jobs dropped this flag once before. https://github.com/kubernetes/test-infra/pull/28389 removed it for kube-apiserver in the 5000 node performance job in January 2023, with this reason: "since we enabled contention profiling of api-server, latency of api calls increased significantly and it introduced some flakiness". That change covered one component in one job. This PR and kubernetes/kops#19086 cover kube-apiserver and kube-controller-manager in all scale jobs. This PR also covers kube-scheduler in the kube-up jobs.

The cost is high, and it changes from one build to the next. In the kOps 5000 node load test, kube-apiserver spends about a quarter of its CPU on it, and some builds take about 50% longer to create the services than others. kubernetes/kops#19086 has the numbers and turns the flag off for the kOps scale jobs. This PR does the same for the jobs that still use kube-up, for example ci-kubernetes-e2e-gce-scale-correctness and the list and write-throughput benchmarks.

The flag came in with #27920 and #28209, one month before #28389, so that ClusterLoader2 could save contention profiles. ClusterLoader2 only saves the block profiles as artifacts. No test checks them.

Changes:

  • kube-apiserver and kube-controller-manager: the flag is removed.

  • kube-scheduler: the presets pass --contention-profiling=false, because kube-scheduler turns contention profiling on by default when profiling is on. kube-up starts kube-scheduler without a config file, so the flag takes effect.

  • --profiling stays, so the CPU and heap profiles are still collected. The block profiles of these components will be empty.
  • The results of the benchmark jobs can change when this merges.

    go test ./config/tests/... passes.

    Related to kubernetes/kubernetes#144231.

    AI use: an AI coding agent did the research and wrote the change. I reviewed and tested the change.

    Diff: 271 lines (+203 / -68) across 3 files Reviewer: upodroid Review duration: 16m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.63) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.63 · 271 lines diff across 3 files
    0.63
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.335
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.063
    Real PR Conversation Timeline
    1 comments
    "Review active on #38351"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 62.6% (MEDIUM) · Higher = larger blast radius
    62.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.7% · Safe to merge
    24.7%