Connections and Postgres

33 views
Skip to first unread message

Henrique Nunes

unread,
Jan 16, 2013, 10:37:08 AM1/16/13
to sqlal...@googlegroups.com
Hi all!

I'm using SQLAlchemy to connect to a Postgres db on several Flask web applications, and I'm investigating connection leaking on them.

From running ps -ef I can see that, immediately after I start my web server, I immediately get one idle connection per web server worker process (gunicorn worker).

Now, on one app I'm not using Flask-SQLAlchemy, but scoped sessions directly. On the other I am using Flask-SQLAlchemy.

Initially I thought it was me not properly removing all the sessions after use, but the fact that the connections are up immediately after I start the servers, before any queries are made, is puzzling me... The fact that it happens with Flask-SQLAlchemy puzzles me even more since it was supposed to take care of removing sessions (even though, in this case, no request is actually made before the connection shows up on ps -ef).

Any thoughts on what might happening?
Reply all
Reply to author
Forward
0 new messages