twitter/querulous — pull request #41 by rvpgithub (2012-03-14 08:42:56+00:00)
Title: Remove the notion of checkoutPool.

The 1 threadpool per AsyncQueryEvaluator strategy used by the checkoutPool results in a ton of single-thread pools created in a gizzard deploy with large number of shards, e.g. flockdb, where each SqlShard is associated with a unique AsyncQueryEvaluator instance. In a canary test of flockdb master in a prod deployment, I saw 32K (!!) of these threads created.

Instead, I think connection checkout should just simply happen on the workPool itself. This is far simpler and doesn't result in thread explosion since the workPool is shared.