Lots of isMaster queries running I see a lot of these kind of queries running  on my primary server where all the replica set members keep checking if the Primary is Primary by running isMaster:

query: { ismaster: true }  ntoreturn: -1 ntoskip: 0

10.117.241.104:27017 &lt;&lt;-- 10.117.241.104:38837 480 bytes id:16f386 1504134 - 1602

reply n:1 cursorId: 0


This is causing a connection bottleneck as my primary has 28000+ connections, which keeps increasing at the rate of 8-10 per second, and takes the primary down.

How can I handle this?
Client lib provides the API for the App to access the MongoDB server. At startup, the client lib will connect to some member (based on a seed list) of the Replica set and issue a isMaster command to gather the current picture of the set (who is the primary and secondaries). After that, the client lib connect to the single primary (where it will send all DB modification request) and some number of secondaries (where it will send read-only queries). The client library will periodically re-run the isMaster command to detect if any new members have joined the set. When an existing member in the set is crashed, connections to all existing clients will be dropped and forces a resynchronization of the latest picture.

I suggest you check the mongod.log for details.