-
Notifications
You must be signed in to change notification settings - Fork 0
Ship default resource requests/limits for cron and consumers #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -274,7 +274,14 @@ cron: | |
| maxSurge: 1 | ||
| maxUnavailable: 0 | ||
| type: RollingUpdate | ||
| resources: {} | ||
| # Conservative defaults (same PHP application image as the webserver); tune per project | ||
| # from real metrics. The legacy package shipped no requests/limits (BestEffort pods). | ||
| resources: | ||
| limits: | ||
| memory: 1Gi | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Medium: This 1Gi memory limit is the actual behavior-risk half of the deviation from legacy BestEffort. The requests are harmless (scheduling hints), but a limit converts "could burst" into "gets OOMKilled": Shopsys cron jobs include memory-heavy work (feed generation, image processing, elasticsearch export), and PHP CLI commonly runs with The PR description already flags the open "verify against production metrics" task — good. Two suggestions:
Not blocking — the value is overridable per environment and the trade-off is a judgment call. — Claude Agent (CR)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed that the 1Gi limit is the risky half. Two-part response in d74fdc4:
|
||
| requests: | ||
| cpu: "100m" | ||
| memory: 300Mi | ||
| securityContext: | ||
| runAsUser: 0 | ||
| podAnnotations: {} | ||
|
|
@@ -308,7 +315,14 @@ consumers: | |
| timeLimit: 300 | ||
| terminationGracePeriodSeconds: 300 | ||
| progressDeadlineSeconds: 600 | ||
| resources: {} | ||
| # Conservative defaults (same PHP application image as the webserver); override per | ||
| # instance or per environment. The legacy package shipped no requests/limits. | ||
| resources: | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Low (verified by rendering): the per-instance override path has an asymmetric consumers:
instances:
- name: heavy
transports: t
resources:
limits:
memory: nullsurvives Nothing to fix in the template; just consider documenting in — Claude Agent (CR)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reproduced the footgun by rendering: per-instance |
||
| limits: | ||
| memory: 1Gi | ||
| requests: | ||
| cpu: "50m" | ||
| memory: 300Mi | ||
| podAnnotations: {} | ||
| podLabels: {} | ||
| nodeSelector: {} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,3 +124,12 @@ Intentional differences of the phase-1 rewrite; everything else is a 1:1 port. | |
| env vars (works with any registry — GCR/GAR via username `_json_key` and the service | ||
| account JSON as the password); the GitLab-flavored `CI_REGISTRY`/`DEPLOY_REGISTER_*` | ||
| variables keep working as a fallback. | ||
| 21. **Default resources for cron and consumers**: the legacy package shipped cron and | ||
| consumer pods with no requests/limits (`BestEffort` QoS). The chart now defaults to | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Low: the entry records the numbers but not the operational implication of the deviation: pods move from — Claude Agent (CR)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in d74fdc4 — deviation entry 21 now states the QoS change (BestEffort → Burstable), the overcommit implication of request 300Mi << limit 1Gi, that bursts past 1Gi are OOMKilled instead of merely evictable, the advice to check peak memory before relying on the defaults, and the |
||
| conservative values (cron: requests `100m`/`300Mi`, consumers: requests `50m`/`300Mi`; | ||
| both limited to `1Gi` memory) — tune them per project/environment via | ||
| `cron.resources` and `consumers.defaults.resources` (or per instance). QoS changes | ||
| from `BestEffort` to `Burstable`: with the request far below the limit nodes can | ||
| overcommit, and anything bursting past `1Gi` is now OOMKilled instead of merely | ||
| evictable — check your crons'/consumers' peak memory usage before relying on the | ||
| defaults, and set `resources: null` on a component to restore the legacy behavior. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: the default and deep-merge cases are covered, but the opt-out escape hatch is not — a test setting
cron.resources: nulland asserting the container has noresourceskey (and/or the equivalent whole-mapresources: nullon a consumer instance incomponent_schema_test.yaml) would pin the behavior projects will rely on to restore legacy BestEffort. I verified by rendering that both currently work; a test keeps them working.— Claude Agent (CR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in d74fdc4:
cron_test.yamlpinscron.resources: null→ noresourceskey on the container, andcomponent_schema_test.yamlpins the per-instance equivalent (resources: nullon a consumer instance). Both pass (64/64); golden snapshots untouched since no rendered output changed.