Frage

when using a DBaaS (database as a service) such as Xeround with a Rails app hosted on EC2 instances, how is it possible to limit the number of concurrent connections to the database (according to the DB service plan limits) ? is it necessary to do so at all ?

I know that ActiveRecord connections pool is per process and is thread safe, but what if there are several processes (also across several different machines) ?

War es hilfreich?

Lösung

Unfortunately there is no way to correctly limit the number of connections across multiple clients (applications). The only way, which is pretty much static and empirical, is to divide the number of max allowed connection by the number of apps and set the result as the connections limit per application.

Andere Tipps

Use a Connection pool base class for managing Active Record database connections.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top