Skip to content

feat(canopy): shm_size_floor spec + intent-driven floors#83

Merged
passcod merged 1 commit into
mainfrom
feat/canopy-shm-floor
Jul 1, 2026
Merged

feat(canopy): shm_size_floor spec + intent-driven floors#83
passcod merged 1 commit into
mainfrom
feat/canopy-shm-floor

Conversation

@passcod

@passcod passcod commented Jul 1, 2026

Copy link
Copy Markdown
Member

🤖 Stacks on #82. Re-lands the shm-floor knob from the closed #80 on top
of the CR-materialisation refactor.

compute_shm_and_shared_buffers derives shm from the postgres pod's
memory request/limit. For analytics-shaped workloads the derived value
is often lower than what shared_buffers actually benefits from, and
bumping memory request just to raise shm burns k8s scheduling budget
for no real gain. shm_size_floor gives the intent (or a user, on the
legacy path) a way to raise shm without touching request/limit.

Adds:

  • PostgresPhysicalReplicaSpec.shmSizeFloor: Option<Quantity> — the
    Deployment builder now takes max(computed_shm, floor) and scales
    shared_buffers_mb proportionally so postgres actually uses the
    extra shm (postgres wants ~70% of shm for shared_buffers).
  • IntentConfig.shm_size_floor per intent — verify: 512Mi,
    analytics-dev / analytics-dbt: 2Gi. IntentConfig::to_replica_spec
    materialises this onto spec.shmSizeFloor when the syncer
    patches the canopy-managed CR.

Legacy CR authors can also set shmSizeFloor directly if their
resource-derived shm undersizes shared_buffers for their workload.

Re-land the shm-floor knob from the closed #80 on top of the CR
materialisation refactor. `compute_shm_and_shared_buffers` derives shm
from the pod's memory request/limit; for analytics workloads that
derived value is often lower than what shared_buffers benefits from,
and bumping memory request just to raise shm burns k8s scheduling
budget for no real gain.

Adds:
- `PostgresPhysicalReplicaSpec.shmSizeFloor: Option<Quantity>` — the
  Deployment builder now takes `max(computed_shm, floor)` and scales
  `shared_buffers_mb` proportionally so postgres actually uses the
  extra shm.
- `IntentConfig.shm_size_floor` (verify: 512Mi, analytics-dev / -dbt:
  2Gi) — materialised into the CR spec by
  IntentConfig::to_replica_spec.
@passcod passcod force-pushed the feat/canopy-cr-materialisation branch from c026bba to 696fc6c Compare July 1, 2026 17:33
@passcod passcod force-pushed the feat/canopy-shm-floor branch from 36b9625 to 9fea1e9 Compare July 1, 2026 17:33
Base automatically changed from feat/canopy-cr-materialisation to main July 1, 2026 17:43
@passcod passcod merged commit 0d1015e into main Jul 1, 2026
25 of 37 checks passed
@passcod passcod deleted the feat/canopy-shm-floor branch July 1, 2026 23:05
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.

1 participant