Reputation: 103
We have a mongodb replica setup with two members and an arbiter:
Yesterday db2 got stuck in an odd state for a few hours. During that time, Mongoid continually tried to connect to the Primary. However, the primary didn't respond, it timed out.
The problem is that it takes 5s to timeout, so 5s out of every 10s the application is blocked by that request, so no database writes/reads can be done. This slowed the database down to the point that it wasn't working.
We are using Mongoid 4, and are trying to determine what we can do to have a decent failover response when a server fails.
Our mongoid.yml is otions are as follows:
options:
write: {w: 1}
read: :primary_preferred
pool_size: 32
pool_timeout: 5
I'm assuming it can check for the servers returning to the set without blocking the other db values.
Any ideas on what or why this is happening?, or ways to improve the behavior?
Upvotes: 2
Views: 207
Reputation: 103
The best solution we found was to upgrade to Mongoid5. Mongoid 5 gives more fail over options.
Upvotes: 0