hackerschool/community — pull request #172 by zachallaun (2014-08-25 21:45:40+00:00)
Title: Monitor connection count in production

The idea here is that, according to our reasoning, we should never have more than 3 checked out DB connections at once per process: two threads running in a Puma worker plus one pubsub thread. This connection monitor logs an error whenever more than 3 connections are checked out, including the call stacks when each connection was checked out so that we can hopefully diagnose which parts of the app are checking out additional connections.