Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions docs/docs/core/settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ If not set, all flows are in a default unnamed namespace.

:::

* `max_connections` (type: `int`, default: `64`): The maximum number of connections to keep in the pool.
* `max_connections` (type: `int`, default: `25`): The maximum number of connections to keep in the pool.

*Environment variable* for `Settings.database.max_connections`: `COCOINDEX_DATABASE_MAX_CONNECTIONS`

* `min_connections` (type: `int`, default: `16`): The minimum number of connections to keep in the pool.
* `min_connections` (type: `int`, default: `5`): The minimum number of connections to keep in the pool.

*Environment variable* for `Settings.database.min_connections`: `COCOINDEX_DATABASE_MIN_CONNECTIONS`

Expand Down Expand Up @@ -134,7 +134,7 @@ This is the list of environment variables, each of which has a corresponding fie
| `COCOINDEX_DATABASE_URL` | `database.url` | Yes |
| `COCOINDEX_DATABASE_USER` | `database.user` | No |
| `COCOINDEX_DATABASE_PASSWORD` | `database.password` | No |
| `COCOINDEX_DATABASE_MAX_CONNECTIONS` | `database.max_connections` | No (default: `64`) |
| `COCOINDEX_DATABASE_MIN_CONNECTIONS` | `database.min_connections` | No (default: `16`) |
| `COCOINDEX_DATABASE_MAX_CONNECTIONS` | `database.max_connections` | No (default: `25`) |
| `COCOINDEX_DATABASE_MIN_CONNECTIONS` | `database.min_connections` | No (default: `5`) |
| `COCOINDEX_SOURCE_MAX_INFLIGHT_ROWS` | `global_execution_options.source_max_inflight_rows` | No (default: `1024`) |
| `COCOINDEX_SOURCE_MAX_INFLIGHT_BYTES` | `global_execution_options.source_max_inflight_bytes` | No |
4 changes: 2 additions & 2 deletions python/cocoindex/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class DatabaseConnectionSpec:
url: str
user: str | None = None
password: str | None = None
max_connections: int = 64
min_connections: int = 16
max_connections: int = 25
min_connections: int = 5


@dataclass
Expand Down
6 changes: 3 additions & 3 deletions src/lib_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ impl DbPools {
let pool_options = PgPoolOptions::new()
.max_connections(conn_spec.max_connections)
.min_connections(conn_spec.min_connections)
.acquire_timeout(Duration::from_secs(5 * 60))
.idle_timeout(Duration::from_secs(10 * 60))
.max_lifetime(Duration::from_secs(60 * 60));
.acquire_slow_level(log::LevelFilter::Info)
.acquire_slow_threshold(Duration::from_secs(10))
.acquire_timeout(Duration::from_secs(5 * 60));
let pool = pool_options
.connect_with(pg_options)
.await
Expand Down
Loading