On Sunday, June 3, 2018 at 10:48:12 PM UTC-4, Mike Bayer wrote:

it seems like your source of connectivity has an idle connection 
> timeout going on.  What version of Postgresql is this, or is this 
> redshift?  are you using a proxy like pgbouncer or haproxy?  
>

Adding a few other things to this:

1. Are you making any connections during the Flask application setup, 
before request processing? That can create issues with connection pools if 
`dispose` is not called.

2. Does a typical request have many blocks of code that execute like this?  
In my experience, doing everything within a miniature sessions or 
transactions like that can create a lot of overhead that makes connections 
and servers work less than optimal.  

I can't remember what happened when I improperly deployed SqlAlchemy in a 
threaded async app years ago, but I think I ended up with some issues like 
you experienced (as well as lots of odd data integrity issues).



-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to