S
Supabase2mo ago
lvcas

Timeouts when running simple queries, fixed for a little when restarting supabase project

Hey, For some reason my supabase is getting a lot of timeouts after a while (less then an hour) and its fixed again when i restart my project. I switched from Neon to Supabase, where this wasnt happening.
async_engine = create_async_engine(
DATABASE_URL,
pool_size=10,
max_overflow=5,
pool_timeout=30,
pool_recycle=1800,
)

# Create a session maker
local_session = async_sessionmaker(
bind=async_engine, class_=AsyncSession, expire_on_commit=False
)
async_engine = create_async_engine(
DATABASE_URL,
pool_size=10,
max_overflow=5,
pool_timeout=30,
pool_recycle=1800,
)

# Create a session maker
local_session = async_sessionmaker(
bind=async_engine, class_=AsyncSession, expire_on_commit=False
)
this is how i create my engine and session maker. Does anyone know what could be causing this?
3 Replies
garyaustin
garyaustin2mo ago
You'll need to look into logs and usage to see if you can find anything to narrow down the issue.
silentworks
silentworks2mo ago
For the DATABASE_URL are you using the transaction or session pooler database connection string?
lvcas
lvcasOP2mo ago
hey bro im using session pooler

Did you find this page helpful?