crossid / accessbot

Streamline resource access grants with AI-Powered chatbot
https://www.crossid.io
Other
2 stars 0 forks source link

More than 20 connections are opened for postgres #186

Closed asaf closed 3 months ago

asaf commented 3 months ago

SqlAlchemy default connection pool is 5, we should check where do we create engines and if we re-use them correctly.

accessbot_postgres_too_many_connections.txt

ErezSha commented 3 months ago

@asaf I don't know what causes it, but it looks like an issue with Azure rather than our code.

I sent 120 concurrent requests to neon, and it works fine. As you can see, the number of connections never went over 12.

Image

In any case, I'll make a PR to use the current engine, I just don't think it's actually the issue.