Skip to content

WordPress: set minRam floors so first-boot install doesn't OOM#67

Open
fxck wants to merge 1 commit into
mainfrom
wordpress-oom-minram-fix
Open

WordPress: set minRam floors so first-boot install doesn't OOM#67
fxck wants to merge 1 commit into
mainfrom
wordpress-oom-minram-fix

Conversation

@fxck

@fxck fxck commented Jul 2, 2026

Copy link
Copy Markdown
Member

The bug

Deploying the WordPress recipe's app-bearing envs OOM-kills at first boot. Every app service runs wp core install via run.initCommands (zsc execOnce wpinit … initialize.sh) — the correct phase for a DB-writing bootstrap (build has no DB, prepare has no files). But the app services were left at the 0.125 GB platform default, and the install spike (php-fpm master+workers ≈ 113 MB + wp-cli ≈ 90 MB) exceeds that. --retryUntilSuccessful then turns the single OOM into a crash loop.

Observed on appdev:

granted 0.12GB … OOM Alert: Process 'zsc' terminated - memory limit exceeded

verticalAutoscaling reacts in 10–20 s and cannot absorb a sub-second spike, so — per the platform's own scaling guidance — the fix is a minRam floor, set in import.yaml (it's not a zerops.yaml field).

The fix (per-env minRam, measured, not guessed)

Env Service Change
AI Agent appdev minRam: 1 + maxContainers: 1
AI Agent appstage minRam: 0.5
Remote (CDE) app minRam: 1 + maxContainers: 1
Stage app minRam: 0.5
HA Production app minRam: 0.5 (under existing cpuMode: DEDICATED)
Small Production app already 0.5 — unchanged
Local no app service — unchanged

1 GB for the dev workstations (they also run composer/wp-cli in-container over SSH) with maxContainers: 1 (dev uses SSHFS — multiple containers conflict). 0.5 GB for the install-spike-only prod/stage apps. HA stays at 0.5 (not 1) to avoid wasting RAM across up to 6 dedicated containers; steady-state autoscales up from the floor.

Derived from a per-env audit against the platform provisioning rules + measured RAM figures on a live php-nginx@8.4 WordPress container.

Not changed (already handled)

The AI-Agent env's appdev/appstage share one DB and both run install at first boot, but initialize.sh guards with wp core is-installed, so the second container skips cleanly; --retryUntilSuccessful + priority: 10 on the stores cover datastore-readiness. No app-repo change needed.

Every app service runs `wp core install` at first boot (base initCommands,
gated by zsc execOnce). On the 0.125 GB platform default, that spike
(php-fpm ~113 MB + wp-cli ~90 MB) OOM-killed the init process, and
--retryUntilSuccessful turned it into a crash loop. verticalAutoscaling
reacts too slowly for a sub-second spike, so the floor must absorb it.

- AI Agent appdev + Remote (CDE) app: minRam 1 + maxContainers 1
  (dev workstations also run composer/wp-cli in-container over SSH; dev
  uses SSHFS so pin a single container).
- AI Agent appstage + Stage app: minRam 0.5 (install-spike only).
- HA Production app: minRam 0.5 under the existing cpuMode DEDICATED
  (0.5, not 1, to avoid wasting RAM across up to 6 dedicated containers;
  steady-state scales up from the floor).
- Small Production already had minRam 0.5; Local has no app service.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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