ruby - Sidekiq workers use too many mongo connections -


i'm running sidekiq under mri 1.9.3, , using mongomapper orm.

my sidekiq workers dying following exception:

mongo::connectiontimeouterror: not obtain connection within 15.0 seconds.  max pool size 40; consider increasing pool size or timeout. 

sidekiq configured run concurrency level of 30.

as can see, i've set mongo connection pool 40 timeout of 15 seconds, thinking should give me more enough mongo connections active sidekiq threads.

however exception happens frequently, particularly when number of active workers approaches maximum.

i've seen mentioned respect mongoid on sidekiq wiki: https://github.com/mperham/sidekiq/wiki/problems-and-troubleshooting#too-many-connections-to-mongodb

however mongoid uses different mongo driver mongomapper, kiqstand middleware doesn't help.

mongomapper uses official mongo driver supposed thread safe , employs connection pool.

what needs happen in sidekiq server middleware free mongomapper connections when thread finishes?


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -