Skip to content

Sped up pnpm dev cold start via tighter compose dev healthchecks#28991

Draft
9larsons wants to merge 4 commits into
mainfrom
pnpm-dev-compose-startup-perf
Draft

Sped up pnpm dev cold start via tighter compose dev healthchecks#28991
9larsons wants to merge 4 commits into
mainfrom
pnpm-dev-compose-startup-perf

Conversation

@9larsons

Copy link
Copy Markdown
Contributor

Changes

  • compose.dev.yaml: ghost-dev healthcheck gains interval: 1s (was Docker default 30s) and retries: 50 (was 10) — matches sibling services and widens cold-boot tolerance to ~55s.
  • compose.dev.yaml: ghost-dev-gateway depends_on ghost-dev relaxed to service_started (was service_healthy). Caddy gateway comes up immediately; compose up --wait no longer blocks on backend healthcheck.

Measured

Cold pnpm dev mean: 22.4s → 15.2s on a 3-trial benchmark, same hardware, identical reset protocol.

Tradeoff

Gateway accepts /ghost/ requests before backend is listening (~11s window). Smoke shows ~3 502s + 1 503 over a ~6s window if the admin tab is open auto-reloading during cold boot; no impact if the user waits for the terminal ready signal. No per-retry log spam since lb_try_duration is unset.

9larsons added 3 commits June 30, 2026 06:56
Docker's default healthcheck interval is 30s. The ghost-dev service
declared no interval, so after start_period elapses, compose up --wait
sat ~5s waiting for the next probe even though backend was already
listening. mysql/redis/mailpit already use interval: 1s — match them.

Cold pnpm dev gateway-ready stage drops ~4.5s on a 22.4s baseline.
Pairs with the interval:1s tightening — interval:1s + retries:10 +
start_period:5s only tolerated ~15s of cold boot. retries:50 widens
the window to ~55s, comfortably covering slower hardware where Ghost
boot takes 30-90s.
The Caddy gateway came up fast (<1s) but was blocked behind ghost-dev's
healthcheck via depends_on: service_healthy. Caddy retries its upstream
on connect-refuse so the brief 502 window during ghost-dev boot is
self-healing. compose up --wait now returns when the gateway is running,
not when the backend is healthy.

Composed with the healthcheck interval tightening, cold pnpm dev
docker_up stage converges close to backend_log_ready.
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f138cee2-2a9b-4bcd-8376-c273eb7aaa1c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pnpm-dev-compose-startup-perf

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jun 30, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit b1de7f0

Command Status Duration Result
nx run @tryghost/admin:build ✅ Succeeded 9s View ↗
nx run ghost:build:assets ✅ Succeeded 2s View ↗
nx run ghost:build:tsc ✅ Succeeded 6s View ↗
nx run-many -t lint -p ghost-monorepo ✅ Succeeded <1s View ↗
nx run-many --target=build --projects=tag:publi... ✅ Succeeded 1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-06-30 14:06:26 UTC

The retries:300 approach kept probing every second indefinitely — fine
for cold-boot detection but noisy in steady state. start_interval/interval
gives both behaviors: 1Hz probing during the 120s start_period for fast
compose --wait clearance, then 30s interval once healthy.

Tolerance: start_period 120s of grace + retries:3 × interval:30s = 210s
before unhealthy. Covers cold boots well past the 60-90s the team sees
on bigger workspaces.
@9larsons 9larsons force-pushed the pnpm-dev-compose-startup-perf branch from 5561677 to b1de7f0 Compare June 30, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant