perf(docker): reduce MongoDB healthcheck overhead - #3878
Open
eralpozcan wants to merge 4 commits into
Open
Conversation
Keep fast startup probes while reducing steady-state mongosh process launches.\n\nRefs bluewave-labs#3877
eralpozcan
requested review from
Br0wnHammer,
ajhollid and
karenvicent
as code owners
August 26, 2026 02:00
ajhollid
requested changes
Aug 26, 2026
ajhollid
left a comment
Collaborator
There was a problem hiding this comment.
I think a better solution here is to just not use mongosh and just see if 27017 accepts a connection.
There's no replica set here, so if 27017 accepts a connection then the service can considered ready.
In essence, make the health check very cheap instead of carrying out the existing expensive check less often.
Please note there is another docker compose file in the docs/hosting dir that also needs to be updated.
Thanks!
Contributor
Author
ajhollid
requested changes
Aug 27, 2026
ajhollid
left a comment
Collaborator
There was a problem hiding this comment.
Check looks good, but there's an extra shell in there that I think we can safely skip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Describe your changes
Replace the MongoDB healthchecks that start a new
mongoshprocess with a lightweight TCP connection check.127.0.0.1:27017using Bash's built-in/dev/tcpsupport.docs/hosting/checkmate-soCompose configurations.Review-driven revision
The initial version reduced the expensive
mongoshprobe frequency from every 5 seconds to every 30 seconds. Following maintainer review, the implementation was revised to remove the expensive process startup instead of running it less often.mongoshpingdocs/hosting/checkmate-soMongoDB servicesAll benchmark results below were rerun against the revised TCP implementation.
Write your issue number after "Fixes "
Fixes #3877
Testing
Local Docker reproduction
mongoshhealthcheck, MongoDB container CPU showed recurring peaks of 56.64%, 47.10%, and 27.48%. A later comparable sample observed a 46.93% peak.mongotopshowed only a few milliseconds of activity per second on thechecks,jobs, andmonitorscollections, separating normal database work from healthcheck process startup.healthyusing the TCP healthcheck.docker compose config --quiet.Self-hosted validation
Validated on a Dokploy-managed self-hosted Checkmate deployment running on a 2-vCPU, 2-GB RAM server. The MongoDB container was limited to 0.75 CPU and 512 MB RAM. Both measurements use the same five-second healthcheck cadence.
mongosh)Before:
After:
Please ensure all items are checked off before requesting a review. "Checked off" means you need to add an "x" character between brackets so they turn into checkmarks.
docker compose config --quiet).