Skip to content

fix(create-a-container): raise default container maxmem to 8GB - #439

Open
runleveldev wants to merge 1 commit into
mainfrom
432
Open

fix(create-a-container): raise default container maxmem to 8GB#439
runleveldev wants to merge 1 commit into
mainfrom
432

Conversation

@runleveldev

Copy link
Copy Markdown
Collaborator

Closes #432. Part of #431 (memory-exhaustion thrash).

Problem

Interactive dev boxes (code-server + extension host + a Vite dev server) realistically need ~6GB. The default of 4GB was too tight and was the root cause in #431: a container held ~3.6GB of unswappable anon memory in a 4GB container, thrashing against its cgroup limit while nodes had ample headroom.

Changes

Server (behavioral):

  • models/resourcerequest.jsRESOURCE_DEFAULTS.memory: 4096 → 8192. This is the canonical default; it feeds the /api/v1/resource-requests/effective endpoint and the auto-approval threshold (requests ≤ default are auto-approved).
  • bin/create-container.js — sourced the creation-time fallbacks (cores/memory/swap/rootfs) from RESOURCE_DEFAULTS instead of hardcoded literals, so the default lives in one place. memory flows into createLxc (Docker-image path) and updateLxcConfig after cloneLxc (template path).

Consistency mirrors:

  • utils/dummy-api.js — dummy node seed memory: 8192
  • client/src/components/containers/ResourcesSection.tsx — UI fallback DEFAULTS.memory: 8192
  • client/src/pages/resource-requests/{ResourceRequestsPage,MyRequestsPage}.tsx — display defaults 8192

Acceptance criteria

  • New containers are created with 8GB maxmem by default
  • Existing per-template/user overrides still work (approvedResources takes precedence over defaults)
  • No node modification required — Proxmox REST API config value only (proxmox-api.js has no defaults; untouched)

Notes

  • swap still defaults to 0 — intentionally out of scope.
  • All edited JS files pass node --check. node_modules is not installed in this environment, so jest/vite were not run here; the client edits are single-literal swaps that don't affect types.

Interactive dev boxes (code-server + extension host + a Vite dev server)
realistically need ~6GB. The 4GB default was too tight and was the root
cause of memory-exhaustion thrash: a container could hold ~3.6GB of
unswappable anon memory against its 4GB cgroup limit while the node had
ample headroom.

Bump the canonical default (RESOURCE_DEFAULTS.memory) to 8192 and source
the creation-time fallbacks in create-container.js from RESOURCE_DEFAULTS
so the default lives in one place. Mirror the value in the dummy node
seed and the client-side display defaults.

Per-user/template overrides still take precedence; swap stays 0.

Closes #432
Copilot AI review requested due to automatic review settings July 31, 2026 19:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Ready to approve

The changes are consistent across server creation defaults, effective-resource defaults, dummy API, and UI fallbacks, and they preserve the existing override precedence model.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Raises the canonical default container memory limit in create-a-container from 4GB to 8GB and wires container-creation fallbacks to use the model’s RESOURCE_DEFAULTS, keeping the creation-time defaults and the resource-request “effective” defaults consistent.

Changes:

  • Increased RESOURCE_DEFAULTS.memory to 8192 MB (auto-approval threshold + /api/v1/resource-requests/effective baseline).
  • Updated create-container.js to source creation-time fallback values from ResourceRequest.RESOURCE_DEFAULTS instead of hardcoded literals.
  • Updated dummy API seed values and client-side “default display/fallback” constants to reflect the new 8GB default.
File summaries
File Description
create-a-container/models/resourcerequest.js Bumps canonical default memory to 8192MB (drives effective resources + auto-approval baseline).
create-a-container/bin/create-container.js Uses ResourceRequest.RESOURCE_DEFAULTS for fallback resources during container creation.
create-a-container/utils/dummy-api.js Updates dummy node/container config seed to 8192MB for consistency in dev/test-like flows.
create-a-container/client/src/components/containers/ResourcesSection.tsx Updates UI fallback defaults to 8192MB.
create-a-container/client/src/pages/resource-requests/ResourceRequestsPage.tsx Updates displayed defaults to 8192MB.
create-a-container/client/src/pages/resource-requests/MyRequestsPage.tsx Updates displayed defaults to 8192MB.
Review details
  • Files reviewed: 5/6 changed files
  • Comments generated: 0
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

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.

Raise default container maxmem to 8GB

2 participants