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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -716,11 +716,11 @@ alembic upgrade head
> `config/*.yaml`. Set them in production to keep secrets out of version control. See
> [docs/CONFIG.md](docs/CONFIG.md) for details.

> ⚙️ Each worker process maintains its own PostgreSQL pool. The default
> `postgres_min_connections` is now `1` so ad-hoc scripts (for example `scripts/run_pipeline.py`)
> can run alongside the five long-lived workers without exhausting the server. Increase the
> minimum only when your database allows additional idle capacity, and adjust
> `POSTGRES_MAX_CONNECTIONS` if you need higher peak throughput.
> ⚙️ Each worker process maintains its own PostgreSQL pool. The defaults keep idle footprint
> low (`postgres_min_connections=1`) and cap peak usage to stay well under the Postgres server
> limit (`postgres_max_connections=10`). This allows ad-hoc scripts (for example
> `scripts/run_pipeline.py`) and tooling like DataGrip to connect reliably even with all workers
> active. Increase these values only when your database has confirmed headroom.

See [MIGRATION_TO_POSTGRES.md](MIGRATION_TO_POSTGRES.md) for complete migration guide.

Expand Down
2 changes: 1 addition & 1 deletion src/adapters/postgres_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}

DEFAULT_POOL_MIN_CONNECTIONS: Final[int] = 1
DEFAULT_POOL_MAX_CONNECTIONS: Final[int] = 50
DEFAULT_POOL_MAX_CONNECTIONS: Final[int] = 10
POOL_ACQUIRE_MAX_ATTEMPTS_DEFAULT: Final[int] = 5
POOL_ACQUIRE_BASE_DELAY_SECONDS: Final[float] = 0.1
POOL_ACQUIRE_MAX_DELAY_SECONDS: Final[float] = 2.0
Expand Down
2 changes: 1 addition & 1 deletion src/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from src.domain.scoring_constants import DEFAULT_THRESHOLD_SCORE

POSTGRES_MIN_CONNECTIONS_DEFAULT: Final[int] = 1
POSTGRES_MAX_CONNECTIONS_DEFAULT: Final[int] = 50
POSTGRES_MAX_CONNECTIONS_DEFAULT: Final[int] = 10
POSTGRES_STATEMENT_TIMEOUT_MS_DEFAULT: Final[int] = 10_000
POSTGRES_CONNECT_TIMEOUT_SECONDS_DEFAULT: Final[int] = 10
POSTGRES_APPLICATION_NAME_DEFAULT: Final[str] = "slack_event_manager"
Expand Down