Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/content/best-practices/running-in-production.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ For PostgreSQL, tune the server database with the following parameters:

- [OPENFGA_DATASTORE_MIN_OPEN_CONNS](../getting-started/setup-openfga/configuration.mdx#OPENFGA_DATASTORE_MIN_OPEN_CONNS): This parameter should be the minimum number of database connections you want to maintain. This helps ensure that a baseline pool of connections is always available. As a starting point, consider setting this to a small, fixed baseline (for example between 5 and 20 connections), or roughly 10–30% of the maximum connections your PostgreSQL instance allows, while ensuring it does not exceed that database limit. If you are running multiple instances of the OpenFGA server, you should divide this setting equally among the instances.

- [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_MAX_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 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.

- The server setting [OPENFGA_DATASTORE_MAX_OPEN_CONNS](../getting-started/setup-openfga/configuration.mdx#OPENFGA_DATASTORE_MAX_OPEN_CONNS) should be set to be equal to your database's max connections. For example, in Postgres, you can see this value via running the SQL query `SHOW max_connections;`. If you are running multiple instances of the OpenFGA server, you should divide this setting equally among the instances. For example, if your database's `max_connections` is 100, and you have 2 OpenFGA instances, `OPENFGA_DATASTORE_MAX_OPEN_CONNS` should be set to 50 for each instance.

Expand Down Expand Up @@ -126,4 +126,4 @@ By default, both ListObjects and ListUsers have a maximum results limit of 1,000
id: '../modeling/migrating/migrating-relations',
}
]}
/>
/>
Loading