Heroku/cleardb: Cannot connected to the database, User has exceeded the 'max_user_connections' resource

2,589 views
Skip to first unread message

Mathias Lin

unread,
Feb 19, 2012, 11:08:33 AM2/19/12
to play-fr...@googlegroups.com
I'm new to the framework and I just setup my Play! (1.2.4) app on heroku using the clearDB mysql database (5MB, 10 max. connections).
My app is actually just the tutorial app from the Play! Cookbook. So it's really very basic, just one entity.

The problem is that the app doesn't run on heroku/cleardb, because the maximum number of connections (for the free account there: 10 max connections) is already exceeded - just by starting up the app.

Error message:
A database error occured : Cannot connected to the database, User 'user' has exceeded the 'max_user_connections' resource (current value: 10)

Why is Play! using so many connections just at startup time? How to get it to use less? Do I need to set the jdbc settings/connection pool settings actually?

My application.conf:
db=fs

and the jdbc settings and connection pool settings all commented out (as it was the default).

Ivan Meredith

unread,
Feb 19, 2012, 8:21:18 PM2/19/12
to play-fr...@googlegroups.com
Because the pool defualts to like 60 connections. Just make it use 10
max... (ie uncomment it out and set it.)

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/hJC-a41455wJ.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.

Mathias Lin

unread,
Feb 20, 2012, 2:58:20 AM2/20/12
to play-fr...@googlegroups.com
Thanks Ivan, I wasn't aware that the default max is around ~60.
I've now uncommented the db pool as well as the jdbc config params, and it's working ok now on Heroku.

One question though, about the mysql5 driver. I have added the very latest mysql connector jar to my lib directory.
But only db.driver=org.gjt.mm.mysql.Driver seems to be working; if I set db.driver=com.mysql.jdbc.Driver‎, I get an error that the driver class could not be found ?!
However, it's definitely inside the mysql-connector-java-5.1.18-bin.jar, and the jar is deployed.

Exception in thread "main" play.exceptions.DatabaseException: Cannot connected to the database, Driver not found (com.mysql.jdbc.Driver‎)

Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages