Skip to content

fix: reduce healthcheck frequency to lower memory pressure#4325

Merged
Siumauricio merged 1 commit intocanaryfrom
fix/3909-healthcheck-interval
Apr 29, 2026
Merged

fix: reduce healthcheck frequency to lower memory pressure#4325
Siumauricio merged 1 commit intocanaryfrom
fix/3909-healthcheck-interval

Conversation

@Siumauricio
Copy link
Copy Markdown
Contributor

@Siumauricio Siumauricio commented Apr 29, 2026

Closes #3909

The HEALTHCHECK was configured with --interval=10s, which triggered a real PostgreSQL query (SELECT 1) 360 times/hour. This kept the Node.js heap under constant pressure, preventing the GC from reclaiming memory efficiently — causing ~350MB of extra memory usage compared to baseline.

Changes

  • --interval: 10s30s (3x fewer DB queries)
  • --timeout: 3s5s (more margin under load)
  • --start-period: added 60s (avoids false failures during Next.js startup)
  • --retries: 105 (was excessive)

Greptile Summary

This PR tunes the HEALTHCHECK instruction in the Dockerfile to reduce the frequency of health queries, lowering constant pressure on the Node.js heap. The four parameter changes (--interval 10s→30s, --timeout 3s→5s, new --start-period=60s, --retries 10→5) are individually sensible and collectively reasonable for a Next.js + Postgres container that takes time to boot. No issues were found.

Confidence Score: 5/5

Safe to merge — single-line Dockerfile change with no logic or security implications.

The only change is adjusting HEALTHCHECK timing parameters, which is a well-justified, low-risk tweak. No new code paths, no security surface changes, and no behavioral regressions are introduced.

No files require special attention.

Reviews (1): Last reviewed commit: "fix: reduce healthcheck frequency to low..." | Re-trigger Greptile

Closes #3909

The previous 10s interval triggered a DB query (SELECT 1) 360 times/hour,
keeping Node.js heap under constant pressure and preventing the GC from
reclaiming memory efficiently. Increasing to 30s reduces query load by 3x.
Also adds start-period=60s to avoid false failures during startup.
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 29, 2026
@Siumauricio Siumauricio merged commit cc7ea51 into canary Apr 29, 2026
5 checks passed
@Siumauricio Siumauricio deleted the fix/3909-healthcheck-interval branch April 29, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Dokploy memory efficiency for low-memory VPS tiers on single-node self-hosted instances

1 participant