I have a single sinatra app running on heroku connecting to a "punch" level clearDB db, which supports 10 connections.
It's unclear to me what that 10 connections limit means? Since I'm only running one app, does that count as just 1 connection? Or if 11 separate users are all using my app at the same time, will that take me over the limit?
Thanks,
Jonah
Help get this topic noticed by sharing it on
Twitter,
Facebook, or email.


-
Hello,
The connection count refers to the actual connections opened by your app to the database. In general, one query = 1 connection. Most queries only take a handful of milliseconds to complete and close the connection, so 10 connections can support many more than 10 simultaneous users, though the exact number and traffic level depends on many factors. -
-
Thanks for the quick reply.
How will I know if I am in danger of going over limit?
Will I be given a warning and a grace period to upgrade if I start to go over my limit?
If so, how long is the grace period? If not, what happens to connections that go over the limit? Do they simply get refused and caused errors in the application? -
-
Hi,
No, there is no warning or grace period, because of the way MySQL operates. If you have 10 connections open, further requests will return an error, saying that the max_connections resource has been exceeded. That will be your signal that it's time to upgrade. Fortunately the upgrade process is extremely simple with Heroku, just a single statement run from your Heroku console. -
-
Will you guys send me an email letting me know that connections have been refused? It seems that otherwise I would never know, especially if it's happening only sporadically, unless a user happens to report it or I am monitoring my log files for that specific error....
Thanks again. -
-
Hello,
No, I'm sorry, we don't monitor or log those events. -
-
Okay thanks for your help. Fwiw it might be a nice service to offer in the future.
-
-
Thanks for the feedback; it's appreciated.
-