Skip to content

perf(docker): optimize MySQL healthcheck parameters to eliminate startup delay - #20482

Merged
JinHai-CN merged 1 commit into
infiniflow:mainfrom
MOHITPRADHAN35:perf/mysql-healthcheck-interval
Oct 9, 2026
Merged

JinHai-CN merged 1 commit into
infiniflow:mainfrom
MOHITPRADHAN35:perf/mysql-healthcheck-interval

Conversation

@MOHITPRADHAN35

Copy link
Copy Markdown
Contributor

Summary

Optimizes the MySQL container healthcheck configuration in docker/docker-compose-base.yml to eliminate unnecessary startup delays.

Closes #20478.

Details

  • Previously, MySQL used interval: 10s and timeout: 10s. Even though MySQL is initialized and accepts connections in ~1.4s, Docker waited up to 10s for the first probe before reporting the service healthy.
  • Because dependent services (like ragflow) wait on condition: service_healthy, this delayed stack startup by ~5 seconds.
  • Adjusts the healthcheck parameters to interval: 1s, timeout: 2s, retries: 30, and start_period: 1s, allowing Docker Compose to detect readiness immediately while preserving 30s of failure tolerance.

Copilot AI balanced review requested due to automatic review settings September 30, 2026 17:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8e7f6664-4489-480b-b63c-f120188aec93

📥 Commits

Reviewing files that changed from the base of the PR and between 9766c8c and 11f2b9c.

📒 Files selected for processing (1)
  • docker/docker-compose-base.yml

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The MySQL healthcheck now runs every second, with a two-second timeout, 30 retries, and a one-second start period.

Changes

MySQL healthcheck

Layer / File(s) Summary
Healthcheck timing
docker/docker-compose-base.yml
The healthcheck interval changed from 10 seconds to 1 second, and the timeout changed from 10 seconds to 2 seconds. Retries changed from 120 to 30. A 1-second start period was added.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: jinhai-cn

Merge Risk: ⚪ Minimal · up to 11f2b

The faster MySQL healthcheck is mergeable after normal checks. No actionable startup regression is established by the available evidence.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 11f2b

The reviewed change does not expand database access or privileges, but substantially reduces tolerance for slow initialization and transient failures. Dependent startup and recovery behavior under prolonged failures remains unverified.

Retained concerns

  • Low · reliability · inferred: The substantially shorter failure window can classify slow-initializing or transiently stalled MySQL as unhealthy earlier, potentially degrading dependent startup containment. The macOS dependency remains optional, so startup failure or bypass behavior depends on deployed Compose semantics and has not been verified.
Security review details

Security Blast Radius

  • inferred — The directly evidenced impact is MySQL health status and its consumption by macOS ragflow startup. The reviewed diff changes timing, not network reachability or privileges; wider consumer and deployment exposure is not established.

Trust Boundaries and Controls

  • observed — The existing probe credential and health-based dependency condition remain unchanged. The optional macOS dependency is also pre-existing; its presence is not evidence of a newly introduced authentication or authorization bypass.

Resilience and Maintainability Implications

  • observed — Both services retain unless-stopped restart policies. The scoped declarations do not specify health-triggered dependent restart or recovery coordination, so those policies alone do not establish recovery from the earlier unhealthy transition.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Docker MySQL healthcheck optimization and its purpose of removing startup delay. It is concise and directly matches the main change.
Description check ✅ Passed The description includes the required Summary section and explains the purpose, background, affected configuration, parameter changes, expected startup impact, and linked issue. The additional Details…
Linked Issues check ✅ Passed The directly linked issue [#20478] requires the MySQL healthcheck in docker/docker-compose-base.yml to use interval: 1s, timeout: 2s, retries: 30, and start_period: 1s. The PR summary shows …
Out of Scope Changes check ✅ Passed The change is limited to the MySQL healthcheck parameters in docker/docker-compose-base.yml. These parameters directly implement issue [#20478]. The summary reports no changes to exported or public …
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

A rabbit checks the clock at dawn,
The MySQL wait grows short and small.
One-second steps mark readiness,
Two seconds cap each check’s length.
Thirty tries, then off I hop!

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

@JinHai-CN

Copy link
Copy Markdown
Member

A longer start_period, e.g. 30s, and a higher retries, e.g. 60 are prefered. Everything else in your proposal looks good.

@JinHai-CN JinHai-CN self-assigned this Oct 8, 2026
@JinHai-CN
JinHai-CN merged commit 747280a into infiniflow:main Oct 9, 2026
1 check passed
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.

[Performance] MySQL healthcheck config causes ~5s unnecessary startup delay

3 participants