mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2026-07-09 16:09:13 +00:00
perf(SKY-8227): re-add DB pool timeout/recycle knobs and API-only pool sizing (#7159)
This commit is contained in:
parent
f920d193eb
commit
f939ec8d32
3 changed files with 48 additions and 0 deletions
|
|
@ -155,6 +155,11 @@ class Settings(BaseSettings):
|
|||
DISABLE_CONNECTION_POOL: bool = False
|
||||
DATABASE_POOL_SIZE: int = 5
|
||||
DATABASE_POOL_MAX_OVERFLOW: int = 10
|
||||
# Timeout/recycle defaults mirror SQLAlchemy's QueuePool. Size pools per service
|
||||
# via env vars: raising defaults here multiplies across every engine and replica
|
||||
# and can exhaust pgbouncer client connections.
|
||||
DATABASE_POOL_TIMEOUT: int = 30
|
||||
DATABASE_POOL_RECYCLE: int = -1
|
||||
PROMPT_ACTION_HISTORY_WINDOW: int = 1
|
||||
TASK_RESPONSE_ACTION_SCREENSHOT_COUNT: int = 3
|
||||
|
||||
|
|
|
|||
|
|
@ -348,6 +348,8 @@ def _build_engine(database_string: str) -> AsyncEngine:
|
|||
pool_pre_ping=True,
|
||||
pool_size=settings.DATABASE_POOL_SIZE,
|
||||
max_overflow=settings.DATABASE_POOL_MAX_OVERFLOW,
|
||||
pool_timeout=settings.DATABASE_POOL_TIMEOUT,
|
||||
pool_recycle=settings.DATABASE_POOL_RECYCLE,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue