Skip to content

feat(roadmap): set each runner Job memory limit to its request #7422

Done

Description

@dan-petty

Problem

A runner Job requests the memory of its size row (2Gi or 6Gi, src/devops_cli/roadmap/implement/implement_size.py), and its limit is the setting roadmap.implement.max_memory_limit (16Gi). The scheduler places a pod by its request only. So a Job can go to a node that cannot hold its limit, and a Job that grows past its request takes memory from the other pods of the node and from the k3s server. #5485 planned a node label and a required node affinity for this, with a homelab play that sets the label (dan-petty/homelab#302).

The owner decided on 2026-11-27: use the standard Kubernetes form, with no custom node label. Memory is not compressible, so the Kubernetes guidance for memory is a request equal to the limit. Then the scheduler keeps each Job off a node with too little free allocatable memory, and a Job cannot burst past what it reserved. dan-petty/homelab#302 is closed as not planned.

Measured on 2026-11-27 (Prometheus, 14 days, container agent of namespace devops, 41 pods): the highest working set of a pod is 4.54 GiB; the 95th percentile of the per-pod peaks is 4.42 GiB. The limit of 16Gi is 3.5 times the highest peak.

Change

  • The memory limit of each runner Job equals its memory request. Each size row of RUNNER_SIZES gives both, from its measured peak with headroom (the row already records peak_bytes).
  • Remove the setting roadmap.implement.max_memory_limit, or keep it only as an upper bound that the validator checks against the rows. Keep the admission policy roadmap-service-jobs and its gate check equal to the rows.
  • Correct docs/CLUSTER.md, docs/CONFIGURATION.md and docs/ENV_VARS.md.
  • Before the change, measure the peak of each row: join the working set with the memory request of each pod (kube-state-metrics), and set each row above its own peak.

Done when

  • A runner Job that the Service builds has a memory request equal to its memory limit, and the admission policy admits it.
  • On the cluster, no runner pod is placed on a node whose free allocatable memory is below its limit (the scheduler gives Insufficient memory for such a node).
  • No runner Job of the next 7 days ends with OOMKilled.

Replaces #5485.

Alternatives check of 2026-11-27: none.
Tool: none found.
Reason: Searches returned only unrelated pages and no open tool that sets a Job's memory limit from the project's RUNNER_SIZES rows. The change lives in the project's own Job template and admission policy, so nothing external covers it.

Lacks:

  • Per-size-row memory request and limit from measured peak
  • Removal or bounding of roadmap.implement.max_memory_limit
  • Admission policy gate and docs kept equal to the rows

Activity

  1. added
    type/feature
    source/agent
    scope/roadmap
    status/new
    value/medium
    priority/p2-medium
    effort/medium
    on Nov 27, 2026
  2. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (8)

    Tools considered:

    Searches run:

    • tool recommends Kubernetes pod memory requests and limits from Prometheus usage, results: 5
    • Kubernetes set memory limit equal to request Guaranteed QoS LimitRange, results: 5
    • LimitRange defaultRequest default memory request equal limit per namespace, results: 5
    • Robusta KRR Kubernetes resource recommendations memory requests limits CLI, results: 5
    • kubernetes limitrange memory documentation, results: 5
    • kubernetes vertical pod autoscaler memory limit request ratio, results: 5
    • LimitRange kubernetes.io docs default memory request limit, results: 5
    • kubernetes limitrange maxLimitRequestRatio memory guaranteed pod, results: 5

    Sources:

  3. added
    status/in-progress
    and removed
    status/new
    on Nov 27, 2026
  4. dan-petty commented on Nov 27, 2026

    @dan-petty
    OwnerAuthor

    Correction of the measurement in this body: the container agent exists only since 2026-11-22 (the three-container Job). In the same 14 days, Jobs that ran the agent step in the one container runner reached 8.05 GiB (confirmed with max(max_over_time(container_memory_working_set_bytes{namespace="devops",container="runner"}[14d]))). So 6Gi does not hold the large row. Pull request 7432 sizes the rows from all these Jobs: 5Gi and 11Gi, each with limit equal to request, at most 80 % of the limit at the peak.

  5. added
    status/in-review
    and removed
    status/in-progress
    on Nov 27, 2026
  6. removed
    status/in-review
    on Nov 27, 2026
  7. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-27 18:39 UTC

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions