-
-
Notifications
You must be signed in to change notification settings - Fork 278
refactor(config): update min idle connections for better performance #2661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe pull request renames three database connection pool constants for consistency and updates the default minimum idle connections from 0 to 1 in the configuration. All references to the renamed constants are updated across the codebase. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
internal/config/config.go (1)
357-365: DefaultMinIdleConnections=1 changes pool behavior for configs that omit this fieldBumping
Database.MinIdleConnectionsfrom 0 to 1 inDefaultConfigmeans that, due to howviper.Unmarshalmerges into a pre-populated struct, deployments that don’t setdatabase.min_idle_connectionsin YAML will now end up withMinIdleConns=1(likely 2 total idle conns: read + write). This looks aligned with the PR’s performance goal, just make sure you’re comfortable with the extra baseline connections after upgrade.The struct field comment at Line 174 (“Must be explicitly set if needed (not set in old code).”) is now slightly misleading, since the code sets a non‑zero default; consider updating it in a follow‑up so the docs match the new behavior.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
internal/config/config.go(1 hunks)pkg/database/postgres/consts.go(1 hunks)pkg/database/postgres/postgres.go(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
internal/config/config.go (1)
pkg/database/postgres/options.go (1)
MinIdleConnections(44-48)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Scan Container for Vulnerabilities
- GitHub Check: Analyze (go)
- GitHub Check: Test with Coverage
- GitHub Check: Test with Coverage
🔇 Additional comments (1)
pkg/database/postgres/postgres.go (1)
64-77: Renamed default constants are wired correctly innewDBThe switch to
_defaultMaxConnections,_defaultMinConnections, and_defaultMaxConnectionLifetimeJitteris consistent with the renamed constants inconsts.go, with no change in behavior. Looks good.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2661 +/- ##
==========================================
+ Coverage 82.52% 82.54% +0.03%
==========================================
Files 74 74
Lines 8125 8125
==========================================
+ Hits 6704 6706 +2
+ Misses 905 904 -1
+ Partials 516 515 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary by CodeRabbit
Improvements
Chores
✏️ Tip: You can customize this high-level summary in your review settings.