Skip to content

docs: Correct OPENFGA_DATASTORE_MIN_IDLE_CONNS description#1250

Open
kamilogorek wants to merge 2 commits into
openfga:mainfrom
kamilogorek:patch-1
Open

docs: Correct OPENFGA_DATASTORE_MIN_IDLE_CONNS description#1250
kamilogorek wants to merge 2 commits into
openfga:mainfrom
kamilogorek:patch-1

Conversation

@kamilogorek
Copy link
Copy Markdown

@kamilogorek kamilogorek commented Apr 28, 2026

OPENFGA_DATASTORE_MIN_IDLE_CONNS should be set to 50-75%, but of OPENFGA_DATASTORE_MIN_OPEN_CONNS and not OPENFGA_DATASTORE_MAX_OPEN_CONNS.

If you set it to 50% of OPENFGA_DATASTORE_MAX_OPEN_CONNS with a recommended 10-30% for OPENFGA_DATASTORE_MIN_OPEN_CONNS then you'll run into panic: datastore MinOpenConns must not be less than datastore MinIdleConns right away.

What you want is (as an example):

  • max: 100
  • min: 20 (20% of max)
  • idle: 10 (50% of min)

Summary by CodeRabbit

  • Documentation
    • Updated PostgreSQL connection-pooling configuration recommendations for production deployments.

Copilot AI review requested due to automatic review settings April 28, 2026 12:41
@kamilogorek kamilogorek requested a review from a team as a code owner April 28, 2026 12:41
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bd43a8fe-b608-465d-ac60-b17d849061bc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Documentation update to PostgreSQL connection-pooling best practices that changes the reference for calculating OPENFGA_DATASTORE_MIN_IDLE_CONNS from OPENFGA_DATASTORE_MAX_OPEN_CONNS to OPENFGA_DATASTORE_MIN_OPEN_CONNS, and adds a missing newline at the end of the file.

Changes

Cohort / File(s) Summary
Documentation
docs/content/best-practices/running-in-production.mdx
Updated PostgreSQL connection-pooling guidance to derive OPENFGA_DATASTORE_MIN_IDLE_CONNS from OPENFGA_DATASTORE_MIN_OPEN_CONNS instead of OPENFGA_DATASTORE_MAX_OPEN_CONNS, and fixed missing newline at end of file.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • rhamzeh
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: correcting documentation for the OPENFGA_DATASTORE_MIN_IDLE_CONNS parameter.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 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_CONNS to OPENFGA_DATASTORE_MIN_OPEN_CONNS is correct and important—it prevents the panic condition where MinIdleConns > MinOpenConns. The 50–75% recommendation aligns well with the 10–30% guidance for MIN_OPEN_CONNS in line 50.

Optional clarification: The phrase "controls how many connections can remain idle before being closed" might be slightly misleading. MIN_IDLE_CONNS actually 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

📥 Commits

Reviewing files that changed from the base of the PR and between cab6706 and c3581a9.

📒 Files selected for processing (1)
  • docs/content/best-practices/running-in-production.mdx

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_CONNS to be a percentage of OPENFGA_DATASTORE_MIN_OPEN_CONNS (not OPENFGA_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.

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.

3 participants