Skip to content

fix(k8s): raise the limits that 7 d of use shows are too low - #5030

Merged
dan-petty merged 2 commits into
mainfrom
fix/4991-raise-measured-limits
Nov 12, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/4991-raise-measured-limits

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

7 days of Prometheus data show memory limits near the peak use and CPU limits that throttle containers that use a few millicores. This change raises them in git.

Memory: Grafana request 256Mi to 512Mi and limit 1024Mi to 2Gi (peak 1014 MiB), LLM gateway 2048Mi to 4Gi (it grows about 170 MiB each day), alloy-metrics 1024Mi to 1536Mi, alloy-logs 512Mi to 768Mi. The gateway does not set MAX_REQUESTS_BEFORE_RESTART, because with one worker and one replica every model call fails until the container starts again. Tempo stays at 2Gi.

CPU limits: redis_exporter sidecars 100m to 500m, node-exporter 200m to 500m (CFS throttled them in 29% to 69% of the periods), roadmap Service 1 to 2 (it reached 1.00 core). The requests stay.

The tests and the spec workload-resource-limits hold the new values.

Closes #4991

Change: openspec/changes/archive/2026-11-12-4991-raise-measured-limits/

Raise the Grafana memory request and limit, the memory limits of the
LLM gateway, alloy-metrics and alloy-logs, the CPU limits of the
redis_exporter sidecars and node-exporter, and the CPU limit of the
roadmap Service. The tests hold the new values.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/k8s Kubernetes commands, Helm charts, pods, services, and policies labels Nov 12, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Before values (7 d to 2026-11-12)

Read from Prometheus through the Grafana datasource on 2026-11-12, with no write to the cluster. The live limits (kube_pod_container_resource_limits) are the same as the values in git on origin/main.

Memory

Query: max by (workload) (label_replace(max_over_time(container_memory_working_set_bytes{namespace=~"monitoring|llm", container=~"grafana|litellm|alloy"}[7d]), "workload", "$1", "pod", "(grafana|llm-gateway|.*alloy-metrics|.*alloy-logs).*")) / 1048576, against kube_pod_container_resource_limits{resource="memory"}.

Container 7 d peak Old limit Peak / old New limit Peak / new
grafana 1014 MiB 1024Mi 99% 2Gi 50%
llm-gateway (litellm) 1333 MiB 2048Mi 65% 4Gi 33%
alloy-metrics 737 MiB 1024Mi 72% 1536Mi 48%
alloy-logs 342 MiB 512Mi 67% 768Mi 45%

The working set at the time of the check: grafana 444 MiB (above the old request of 256Mi), litellm 762 MiB.

CPU

Throttled share: sum by (workload, container) (increase(container_cpu_cfs_throttled_periods_total[7d])) / sum by (workload, container) (increase(container_cpu_cfs_periods_total[7d])).
Peak use: max_over_time(rate(container_cpu_usage_seconds_total[1m])[7d:1m]) (exporters) and max_over_time(rate(container_cpu_usage_seconds_total{container="service"}[2m])[7d:1m]) (Service).
Scrape time: quantile_over_time(0.5, scrape_duration_seconds[7d]), the largest target of each job.

Container Throttled share Peak use Median scrape Old limit New limit
valkey redis-exporter 69% 21m 0.46 s 100m 500m
valkey-devops redis-exporter 52% 12m 0.19 s 100m 500m
argocd-redis metrics 57% 2m 0.25 s 100m 500m
node-exporter 29% 33m 1.92 s 200m 500m
roadmap-service service 8% 1.00 core n/a 1 2

For comparison, the median scrape of the Prometheus self target is 0.008 s.

Scheduling: only the Grafana memory request grows (256Mi). Each node had 21 GiB or more of allocatable memory that no running pod requests, from kube_node_status_allocatable{resource="memory"} minus the requests of the running pods.

Fail-to-pass

uv run devops ci fail-to-pass --base origin/main:

failed on base: tests.ai.benchmark.test_k8s_llm_gateway.TestK8sLLMGatewayManifests::test_gateway_deployment_security_and_resources (AssertionError: assert ('llm', True,... '1000m', ...) == ('llm', True,... '1000m', ...))
failed on base: tests.commands.k8s.test_k8s::test_k8s_workload_resource_limits_and_probes (AssertionError: assert ['100m', '100m'] == ['500m', '500m'])
failed on base: tests.server.routes.test_k8s_roadmap_service::test_deployment_memory_is_sized_for_the_observed_growth (AssertionError: assert ('768Mi', '3Gi', '100m', '1') == ('768Mi', '3Gi', '100m', '2'))
3 failed on base (3 failed and 195 passed in tests/ai/benchmark/test_k8s_llm_gateway.py, tests/commands/k8s/test_k8s.py, tests/server/routes/test_k8s_roadmap_service.py; 0 errored).

Local checks on the branch

  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-tree: all pass.
  • uv run devops ci --check --only k8s: 107 cases, 0 failed.
  • uv run devops ci test tests/invariants/test_k8s_*.py tests/k8s/test_k8s_valkey_stack.py tests/commands/k8s/test_k8s_monitoring_integration.py tests/prometheus/test_k8s_monitoring_alerting.py tests/config/test_k8s_devops_runtime.py: 288 passed.
  • kubeconform did not run locally: the workstation binary is a stub left by the incident of fix(tests): test helpers write to the real home outside pytest #4739.

After the merge

7 d after the merge, a second comment records the peak against the new limit and the throttled share of each container, with the same queries.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 10:22
@dan-petty
dan-petty merged commit 028c62b into main Nov 12, 2026
23 checks passed
@dan-petty
dan-petty deleted the fix/4991-raise-measured-limits branch November 12, 2026 12:09
dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.118.0](v0.117.2...v0.118.0)
(2026-11-12)


### Features

* **ci:** devops ci stops its rows when timeout ends it
([#5031](#5031))
([1fa4e9c](1fa4e9c))
* **roadmap:** keep the stage gate problems as a list with a code
([#5022](#5022))
([5819627](5819627))
* **roadmap:** log one result line for each roadmap job attempt
([#4966](#4966))
([2b6fe3f](2b6fe3f))
* **telemetry:** record each CLI usage error by name and kind
([#4973](#4973))
([a179fd9](a179fd9))


### Bug Fixes

* **ai:** chat loads each persona prompt and challenger gets tools
([#5037](#5037))
([c40b0ad](c40b0ad))
* **ai:** keep the HTTP status of a Claude reply after retries
([#4976](#4976))
([5bf9466](5bf9466))
* **deps:** keep Renovate uv bumps green and groups on Monday
([#4987](#4987))
([b19e153](b19e153))
* **k8s:** raise the limits that 7 d of use shows are too low
([#5030](#5030))
([028c62b](028c62b))
* **roadmap:** a job posts no comment that repeats a recent one
([#4978](#4978))
([fff903a](fff903a))
* **service:** alert when GitHub cannot deliver a webhook
([#5045](#5045))
([2bfbfcb](2bfbfcb))
* **service:** delete the stream route that sends canned verified text
([#5038](#5038))
([e9d51b5](e9d51b5))
* **telemetry:** keep one upstream status series per service
([#4986](#4986))
([3e4ca56](3e4ca56))
* **tests:** remove the runner variable in the test floor
([#4988](#4988))
([093aa61](093aa61))


### Performance Improvements

* **ai:** make the ast graph walk and call search faster
([#5039](#5039))
([3b25cc6](3b25cc6)),
closes [#4662](#4662)
* **ci:** build the devcontainer only on its own inputs
([#4977](#4977))
([c5b15ac](c5b15ac))
* **ci:** test each merge once, on the push to main
([#5043](#5043))
([c6992b1](c6992b1))
* **tests:** remove fixed waste in six slow tests
([#4995](#4995))
([1c7044e](1c7044e))


### Code Refactoring

* **ai:** delete devops ai pipeline and persona leftovers
([#5044](#5044))
([d5fefde](d5fefde)),
closes [#4827](#4827)
* **openspec:** split big capabilities into nested ones
([#4981](#4981))
([dfb09bd](dfb09bd))
* **pr:** devops pr update acts only on a failed check
([#4990](#4990))
([aa4fa1a](aa4fa1a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
@dan-petty

Copy link
Copy Markdown
Owner Author

Before values of the roadmap Service (missing from the evidence comment)

Issue #4991 asks for the Service event-loop lag or round time as a before value. This comment adds it, so the comment 7 days after the merge has a baseline.

Window: the 7 days before the merge, 2026-11-05T12:09:50Z to 2026-11-12T12:09:50Z (merge commit 028c62b). Each query is an instant query at 2026-11-12T12:09:50Z on the Prometheus data source.

Event-loop lag: no metric exists. The metric names that match .*(event_loop|loop_lag|eventloop).* are only the redis_* series of Valkey. Thus the round time is the baseline.

Round time (mean time of one job, by lane):

Lane Jobs in 7 d Mean job time Median of the hourly means Highest hourly mean
status 33,040 16.3 s 12.7 s 85.7 s
triage 4,774 56.1 s 50.6 s 278.9 s
model 4,770 87.9 s 89.6 s 330.5 s
# Jobs in 7 d
sum by (lane) (increase(devops_cli_service_jobs_total[7d]))
# Mean job time
sum by (lane) (increase(devops_cli_service_job_seconds_total[7d])) / sum by (lane) (increase(devops_cli_service_jobs_total[7d]))
# Median of the hourly means
quantile_over_time(0.5, (sum by (lane) (increase(devops_cli_service_job_seconds_total[1h])) / sum by (lane) (increase(devops_cli_service_jobs_total[1h])))[7d:1h])
# Highest hourly mean
max by (lane) (max_over_time((sum by (lane) (increase(devops_cli_service_job_seconds_total[1h])) / sum by (lane) (increase(devops_cli_service_jobs_total[1h])))[7d:1h]))

CPU throttled share of container service: 7.6% at the old limit of 1 core.

sum by (namespace, container) (increase(container_cpu_cfs_throttled_periods_total{container="service"}[7d])) / sum by (namespace, container) (increase(container_cpu_cfs_periods_total{container="service"}[7d]))

node-exporter scrape time (median of 7 d, by node): 1.92 s on the slowest node, 0.16 s to 0.26 s on the other three. The follow-up compares it with this value, because the CPU limit of 500m may not make that scrape faster.

sort_desc(quantile_over_time(0.5, scrape_duration_seconds{job="integrations/node_exporter"}[7d]))

kubeconform: I rendered k8s/llm and k8s/devops of merge commit 028c62b with kubectl kustomize and ran kubeconform 0.8.0 (-strict -summary -ignore-missing-schemas): 80 resources, 75 valid, 0 invalid, 0 errors, 5 skipped (custom resources). The renders hold the new values (litellm 4Gi, Service CPU 2). No CI job runs kubeconform: #5084 tracks that gap.

Follow-up: on 2026-11-19 at 12:09 UTC or later, run the same queries with the end time 2026-11-19T12:09:50Z, and put the values beside these in a new comment.

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

Labels

scope/k8s Kubernetes commands, Helm charts, pods, services, and policies type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(k8s): raise the limits that 7 d of use shows are too low

1 participant