From 0f4dc4416c0ee653ee56bb6fd25b18268ba692c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Voron?= Date: Sun, 13 Oct 2024 11:17:17 +0200 Subject: [PATCH] Document DATABASE_POOL_SIZE and DATABASE_POOL_MAX_OVERFLOW --- docs/self-hosting/environment-variables.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/self-hosting/environment-variables.md b/docs/self-hosting/environment-variables.md index a0a09b7..51fa660 100644 --- a/docs/self-hosting/environment-variables.md +++ b/docs/self-hosting/environment-variables.md @@ -66,13 +66,13 @@ For each variable, we'll try to provide a sensible example value to help you con ### General -| Name | Description | Default | Allowed values | Example | -| --------------------- | ----------------------------------------------------------------------------------------- | --------------------------- | -------------------------------- | ---------------------------- | -| `ENVIRONMENT` | Name of the deployment environment | production | development, staging, production | production | -| `LOG_LEVEL` | Log verbosity | | | | -| `TELEMETRY_ENABLED` | Whether to enable [telemetry](../telemetry.md) | True | | | -| `ALLOW_ORIGIN_REGEX` | Regex used to control CORS access to your API | http://.\*localhost:\[0-9]+ | | https://.\*\\.bretagne.duchy | -| `PORT` | Internal port on which the Fief server is available | 8000 | | 8000 | +| Name | Description | Default | Allowed values | Example | +| --------------------- | -------------------------------------------------------------------------------------------- | --------------------------- | -------------------------------- | ---------------------------- | +| `ENVIRONMENT` | Name of the deployment environment | production | development, staging, production | production | +| `LOG_LEVEL` | Log verbosity | | | | +| `TELEMETRY_ENABLED` | Whether to enable [telemetry](../telemetry.md) | True | | | +| `ALLOW_ORIGIN_REGEX` | Regex used to control CORS access to your API | http://.\*localhost:\[0-9]+ | | https://.\*\\.bretagne.duchy | +| `PORT` | Internal port on which the Fief server is available | 8000 | | 8000 | | `FORWARDED_ALLOW_IPS` | Comma separated list of IPs to trust with proxy headers. [Read more](./configuration/ssl.md) | 127.0.0.1 | | | ### Secrets @@ -97,8 +97,10 @@ For each variable, we'll try to provide a sensible example value to help you con | `DATABASE_NAME` | Main database name | fief.db | | fief | | `DATABASE_SSL_MODE` | Main database SSL mode | | Varies by database type | require | | `DATABASE_LOCATION` | For SQLite databases, path where to store the database files | Current working directory | | | -| `DATABASE_POOL_RECYCLE_SECONDS` | Maximum lifetime in seconds of a database connection in the connection pool. Useful for servers cutting idle connections after some time. [Read more](https://docs.sqlalchemy.org/en/14/core/pooling.html#disconnect-handling-pessimistic). | 600 *(10 minutes)* | | | -| `DATABASE_POOL_PRE_PING` | Whether to always issue a query before returning a database connection to make sure it's alive. [Read more](https://docs.sqlalchemy.org/en/14/core/pooling.html#disconnect-handling-pessimistic). | False | | | +| `DATABASE_POOL_RECYCLE_SECONDS` | Maximum lifetime in seconds of a database connection in the connection pool. Useful for servers cutting idle connections after some time. [Read more](https://docs.sqlalchemy.org/en/20/core/pooling.html#disconnect-handling-pessimistic). | 600 *(10 minutes)* | | | +| `DATABASE_POOL_PRE_PING` | Whether to always issue a query before returning a database connection to make sure it's alive. [Read more](https://docs.sqlalchemy.org/en/20/core/pooling.html#disconnect-handling-pessimistic). | False | | | +| `DATABASE_POOL_SIZE` | Number of connections to the database to keep alive. [Read more](https://docs.sqlalchemy.org/en/20/core/pooling.html#sqlalchemy.pool.QueuePool.params.pool_size). | 5 | | | +| `DATABASE_POOL_MAX_OVERFLOW` | Maximum number of extra database connection to spawn when pool size is reached. [Read more](https://docs.sqlalchemy.org/en/20/core/pooling.html#sqlalchemy.pool.QueuePool.params.max_overflow). | 10 | | | | `DATABASE_URL` | Full database connection string, useful for some cloud providers. It'll take precedence over the single parameters above. | | | | More details about how to configure a database in the dedicated section.