문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top