I had this same problem when connecting to my staging database from my local rails console, made it nearly unusable. I'm using Mongo 2.21.0 and Mongoid 9.0.3
Worked around it by setting heartbeat_frequency: 10000 (instead of 10) in mongoid.yml
heartbeat_frequency: 10000
mongoid.yml