I'm using readPreference:nearest with my replica set, and I noticed that setting this option causes my logs to grow (a lot over time). I checked out my logs, and I see a bunch of rows that repeat (causing the growth):
connection accepted from IP
end connection IP
This doesn't happen when I set readPreference to anything else. I don't want to incur the overhead of connect/reconnect, so I'm wondering if this is a problem, or it it's normal behavior?
Here's my client code, using node native driver:
var server = 'mongodb://'+dbh[0]+','+dbh[1]+','+dbh[2]+'/0?w=3&readPreference=nearest';
var options = {
db: {},
server: {},
replSet: {
rs_name: 'rs0',
strategy: 'ping',
secondaryAcceptableLatencyMS: 50,
},
mongos: {}
};
_m.MongoClient.connect(server, options, function(err, db){