Skip to content

Commit

Permalink
Merge pull request #271 from arXiv/ARXIVCE-1639-browse-traces
Browse files Browse the repository at this point in the history
Found the config Jonathan is skeptical of
  • Loading branch information
mnazzaro authored May 10, 2024
2 parents 5ac92e6 + 805ed44 commit f707487
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions arxiv/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ class Settings(BaseSettings):
CLASSIC_DB_TRANSACTION_ISOLATION_LEVEL: Optional[IsolationLevel] = None
LATEXML_DB_TRANSACTION_ISOLATION_LEVEL: Optional[IsolationLevel] = None

# How many requests do we handle at once -> How many db connections should we be able to open at once
REQUEST_CONCURRENCY: int = 32

""" How many requests do we handle at once -> How many db connections should we be able to open at once """
POOL_PRE_PING: bool = True
""" Liveness check of sqlalchemy connections before checking out of pool """
settings = Settings()
6 changes: 4 additions & 2 deletions arxiv/db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ class LaTeXMLBase(DeclarativeBase):
echo=settings.ECHO_SQL,
isolation_level=settings.CLASSIC_DB_TRANSACTION_ISOLATION_LEVEL,
pool_recycle=600,
max_overflow=(settings.REQUEST_CONCURRENCY - 5)) # max overflow is how many + base pool size, which is 5 by default
max_overflow=(settings.REQUEST_CONCURRENCY - 5), # max overflow is how many + base pool size, which is 5 by default
pool_pre_ping=settings.POOL_PRE_PING)
latexml_engine = create_engine(settings.LATEXML_DB_URI,
echo=settings.ECHO_SQL,
isolation_level=settings.LATEXML_DB_TRANSACTION_ISOLATION_LEVEL,
pool_recycle=600,
max_overflow=(settings.REQUEST_CONCURRENCY - 5))
max_overflow=(settings.REQUEST_CONCURRENCY - 5),
pool_pre_ping=settings.POOL_PRE_PING)
SessionLocal = sessionmaker(autocommit=False, autoflush=False)

def _app_ctx_id () -> int:
Expand Down

0 comments on commit f707487

Please sign in to comment.