Hi there,
I've been running into frequent Mongo::ConnectionTimeoutError exceptions when running MongoMapper behind Sidekiq.
I'm running a Sidekiq server with 30 concurrent actors on MRI 1.9.3. I've configured Mongo to use a connection pool with 40 connections and a 15 second timeout, figuring that should more than cover me. However I hit these timeouts constantly:
Mongo::ConnectionTimeoutError: could not obtain connection within 15.0 seconds. The max pool size is currently 40; consider increasing the pool size or timeout.
As far as I've read online, MongoMapper is thread safe, but I'm wondering if the connections to mongo are not being closed when a Sidekiq thread finishes?
Is something similar necessary for MongoMapper? Any advice would be extremely appreciated, and I'm happy to implement the solution myself, if someone could point me in the right direction.
Thanks!