Vote count:
0
We are working on a simple Rails 4 webapp, hosted by Heroku with the free plan.
Since we introduced real time notifications with Pusher, we are experiencing some ActiveRecord::ConnectionTimeoutError - one every few days - and we don't really understand the reasons behind it.
We know Heroku sets a pool limit of 20 connections to the Postgres db, and this is most likely the the reason why the exception is thrown. Anyway, there are many things we don't understand:
What does the
20actually mean? Is it the number of queries that the db can process at the same time? So, in case we have more than 20 users online we are in troubles? This seems strange, since even upgrading the Postgres plan we can get up to a pool of 200... which is not much!How can we debug this? The heroku logs don't give us enough line to get to source of the exception.
Is there a way to monitor the number of connections to the db? Or, even better, to get the picks for each day?
We set up a custom
error 500page, which works in most of the cases. However, with this exception and some few others, the server seems to loop an indefinite amount of time and request our custom paga again and again until the server crashes. Then, the only way to recover the website is through anheroku restart. Is there a way to avoid this behavior, so that an occurrence of the exception does not kill the website?
Any help and/or insight is greatly appreciated!
Aucun commentaire:
Enregistrer un commentaire