Heroku “psql: FATAL: remaining connection slots are reserved for non-replication superuser connections”-open source projects koush/Superuser

markshiz

I actually tried to implement connection pooling on the django end using:

https://github.com/gmcguire/django-db-pool

but I still received this error, despite lowering the number of connections available to below the standard development DB quota of 20 open connections.

There is an article here about how to move your postgresql database to the free/cheap tier of Amazon EC2. This would allow you to set max_connections higher. This will also allow you to pool connections at the database level using PGBouncer.

http://www.askthepony.com/blog/2011/07/getting-django-on-heroku-prancing-8-times-faster/

UPDATE:

Heroku responded to my open ticket and stated that my database was improperly load balanced in their network. They said that improvements to their system should prevent similar problems in the future. Nonetheless, support manually relocated my database and performance is noticeably improved.