docs: Correct OPENFGA_DATASTORE_MIN_IDLE_CONNS description#1250
docs: Correct OPENFGA_DATASTORE_MIN_IDLE_CONNS description#1250kamilogorek wants to merge 3 commits into
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughDocumentation update to PostgreSQL connection-pooling best practices that changes the reference for calculating Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
🧹 Nitpick comments (1)
docs/content/best-practices/running-in-production.mdx (1)
52-52: Excellent fix! Consider minor wording clarification.The change from
OPENFGA_DATASTORE_MAX_OPEN_CONNStoOPENFGA_DATASTORE_MIN_OPEN_CONNSis correct and important—it prevents the panic condition whereMinIdleConns > MinOpenConns. The 50–75% recommendation aligns well with the 10–30% guidance forMIN_OPEN_CONNSin line 50.Optional clarification: The phrase "controls how many connections can remain idle before being closed" might be slightly misleading.
MIN_IDLE_CONNSactually sets the minimum number of idle connections to maintain in the pool (a floor, not a closing threshold). Consider rewording for precision:📝 Optional wording improvement
-[OPENFGA_DATASTORE_MIN_IDLE_CONNS](../getting-started/setup-openfga/configuration.mdx#OPENFGA_DATASTORE_MIN_IDLE_CONNS): This parameter controls how many connections can remain idle before being closed. As a starting point, set this to around 50–75% of your `OPENFGA_DATASTORE_MIN_OPEN_CONNS` value to maintain a stable connection pool and avoid the overhead of frequently recreating connections, then adjust based on observed connection churn and database load. +[OPENFGA_DATASTORE_MIN_IDLE_CONNS](../getting-started/setup-openfga/configuration.mdx#OPENFGA_DATASTORE_MIN_IDLE_CONNS): This parameter sets the minimum number of idle connections to maintain in the pool. As a starting point, set this to around 50–75% of your `OPENFGA_DATASTORE_MIN_OPEN_CONNS` value to maintain a stable connection pool and avoid the overhead of frequently recreating connections, then adjust based on observed connection churn and database load.Optional enhancement: To help readers understand the relationship between all three parameters, consider adding a concrete example:
📚 Example addition
After line 52, you could add:
For example, if your database's `max_connections` is 100: - `OPENFGA_DATASTORE_MAX_OPEN_CONNS`: 100 - `OPENFGA_DATASTORE_MIN_OPEN_CONNS`: 20 (20% of max) - `OPENFGA_DATASTORE_MIN_IDLE_CONNS`: 10-15 (50-75% of min open)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/content/best-practices/running-in-production.mdx` at line 52, The sentence describing OPENFGA_DATASTORE_MIN_IDLE_CONNS is misleading; update the wording so it states that OPENFGA_DATASTORE_MIN_IDLE_CONNS defines the minimum number of idle connections the pool will try to maintain (a floor), not a threshold for closing connections, and keep the recommendation that it be set to ~50–75% of OPENFGA_DATASTORE_MIN_OPEN_CONNS; optionally append the concrete example illustrating the three parameters (OPENFGA_DATASTORE_MAX_OPEN_CONNS, OPENFGA_DATASTORE_MIN_OPEN_CONNS, OPENFGA_DATASTORE_MIN_IDLE_CONNS) to clarify their relationship.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@docs/content/best-practices/running-in-production.mdx`:
- Line 52: The sentence describing OPENFGA_DATASTORE_MIN_IDLE_CONNS is
misleading; update the wording so it states that
OPENFGA_DATASTORE_MIN_IDLE_CONNS defines the minimum number of idle connections
the pool will try to maintain (a floor), not a threshold for closing
connections, and keep the recommendation that it be set to ~50–75% of
OPENFGA_DATASTORE_MIN_OPEN_CONNS; optionally append the concrete example
illustrating the three parameters (OPENFGA_DATASTORE_MAX_OPEN_CONNS,
OPENFGA_DATASTORE_MIN_OPEN_CONNS, OPENFGA_DATASTORE_MIN_IDLE_CONNS) to clarify
their relationship.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4b913792-fd3c-4755-8178-fd92b0381fb9
📒 Files selected for processing (1)
docs/content/best-practices/running-in-production.mdx
There was a problem hiding this comment.
Pull request overview
Updates the production tuning guidance for PostgreSQL connection pool settings to prevent invalid configurations and align OPENFGA_DATASTORE_MIN_IDLE_CONNS guidance with the intended relationship to OPENFGA_DATASTORE_MIN_OPEN_CONNS.
Changes:
- Corrects the recommended baseline calculation for
OPENFGA_DATASTORE_MIN_IDLE_CONNSto be a percentage ofOPENFGA_DATASTORE_MIN_OPEN_CONNS(notOPENFGA_DATASTORE_MAX_OPEN_CONNS). - Normalizes the MDX formatting for the
<RelatedSection />closing line (whitespace-only change).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
OPENFGA_DATASTORE_MIN_IDLE_CONNSshould be set to 50-75%, but ofOPENFGA_DATASTORE_MIN_OPEN_CONNSand notOPENFGA_DATASTORE_MAX_OPEN_CONNS.If you set it to 50% of
OPENFGA_DATASTORE_MAX_OPEN_CONNSwith a recommended 10-30% forOPENFGA_DATASTORE_MIN_OPEN_CONNSthen you'll run intopanic: datastore MinOpenConns must not be less than datastore MinIdleConnsright away.What you want is (as an example):
Summary by CodeRabbit