Your sessions are never closed, so each request keeps a connection until the pool runs dry. Bigger pool = slower leak.
Make it a dependency with yield so FastAPI closes it after the response:
def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()
@app.get("/items")
def list_items(db: Session = Depends(get_db)):
...Then put pool_size back to the default. If you run on a host that drops idle connections, add pool_pre_ping=True to create_engine too.