diff --git a/source/en/mongoid/v3/tips.haml b/source/en/mongoid/v3/tips.haml index fa44c9e1..e4fcb4f0 100644 --- a/source/en/mongoid/v3/tips.haml +++ b/source/en/mongoid/v3/tips.haml @@ -251,13 +251,19 @@ %h2 Sidekiq %p - If you are using Sidekiq, you need to ensure that MongoDB sessions are - diconnected after each worker runs, or you will quickly overload MongoDB - with more active connections than it can handle. In order to handle this + If you are using Sidekiq, you need to ensure that your identity map is cleared + after each job runs. In order to handle this seamlessly for you, we have provided a gem with a Sidekiq middleware that handles this - Kiqstand. You will need to be on Mongoid version 3.0.3 or higher. + %p + When using Sidekiq, connections will disconnect from MongoDB at each job since + sessions are stored on Fiber-local variables. If you want to reuse connections, + you can patch Celluloid::Thread. See + this discussion on the Mongoid + users group for more information. + %p To use Kiqstand, first add it to your Gemfile.