Lately I have spotted that some of the connection request between my Django app and remote Postgres DB are randomly failing.
OperationalError: could not connect to server: Connection refused
Is the server running on host "xxxxx" (xx.xx.xx.xx) and accepting
TCP/IP connections on port 5432?
Since I have a very limited access to the database host, I came across with a solution, which is creation of a persistent connections:
There is in fact an implementation of reusing SQLAlchemy's connection
pool with Django (via DatabaseWrapper subclassing):
So far worksforme. :-)
BTW: Please note that django-postgrespool by default will not work with Django 1.6 due to this patch:
What you can do is to try to revert it or go for >1.6 or <1.6.