1

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

Kappa
  • 1,015
  • 1
  • 16
  • 31
Gal Ben-Haim
  • 17,433
  • 22
  • 78
  • 131

2 Answers2

1

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.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Avigail Ofer
  • 111
  • 2
0

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

ifixthat
  • 6,137
  • 5
  • 25
  • 42
Offir
  • 1
  • 1
    Connection pool is only for the same process. the question is referring to processes across various EC2 instances. – Gal Ben-Haim Jul 16 '12 at 14:29