Waiting for external requests are occupying db connections #1368
Unanswered
JonasRueegsegger
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using flask-sqlalchemy for my web application. A request from a client has more or less these steps
Now my issue is, that when scaling up and using flask-sqlalchemy, the request bound sessions provided by flask-sqlalchemy are occupying the db connections from the pool also during the time waiting for the external provider. This is leading to lots of db connections occupied for several seconds. So I started to close the session before making the requests to the external providers.
This is working, but I have to pay lots of attention to not close the shared session (within the request) at the wrong time.
My question would be, is it also possible to have more than one session at the same time within one request with flask-sqlalchemy or would you recommend me to switch using the sqlalchemy package directly in this case?
Beta Was this translation helpful? Give feedback.
All reactions