Question

I have set up three Play 2.1.1 application (Api, Admin Panel and Website) on heroku with postgresql as the database. Out of these the Api and the Admin Panel are accessing the database. The postgresql package I have set up consists of following configurations:

Connection Limit : 60
Row Limit : Unlimited
RAM : 410 MB

I have the following configurations in the Play application for the database in both Api & Admin Panel:

db.default.url=DATABASE_URL
db.default.partitionCount=1
db.default.maxConnectionsPerPartition=10
db.default.minConnectionsPerPartition=5
db.default.driver="org.postgresql.Driver"
db.default.idleMaxAge=10 minutes
db.default.idleConnectionTestPeriod=30 seconds
db.default.connectionTimeout=20 second
db.default.connectionTestStatement="SELECT 1"
db.default.maxConnectionAge=30 minutes

I am getting the Timeout exception for connecting to database of BoneCp. I just want someone to verify if the above configurations are right so that I can debug in right way. Please help me with the same. Thank you.

Was it helpful?

Solution

heroku close all connections after 30 seconds so your maxConnectionAge has to be lower than 30s

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top