Question

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) ?

Was it helpful?

Solution

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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top