Skip to content

Commit

Permalink
Document DATABASE_POOL_SIZE and DATABASE_POOL_MAX_OVERFLOW
Browse files Browse the repository at this point in the history
  • Loading branch information
frankie567 committed Oct 13, 2024
1 parent 8b9971b commit 0f4dc44
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions docs/self-hosting/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 0f4dc44

Please sign in to comment.