Mongo DB stoped responding taking long time to fetch or insert

Working mongo db stopped suddenly,

I am using MongoDB, ip address is added successfuly and it was woking fine but suddemly twice in a day it stops some times it is too slow it takes many times to send get response. i have got log as below:


MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/
......
at new Promise (<anonymous>)
......
reason: TopologyDescription {

type: 'ReplicaSetNoPrimary',
setName: 'atlas-x00t1p-shard-0',
maxSetVersion: 16,
maxElectionId: 7fffffff00000000000005b9,

servers: Map(3) {
'laksh-prod-shard-00-00.lubos.mongodb.net:27017' => [ServerDescription],
'laksh-prod-shard-00-01.lubos.mongodb.net:27017' => [ServerDescription],
'laksh-prod-shard-00-02.lubos.mongodb.net:27017' => [ServerDescription]
},

stale: false,
compatible: true,
compatibilityError: null,
logicalSessionTimeoutMinutes: null,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
commonWireVersion: 17

}

using mongo db dedicated cluster :

CLUSTER TIER M20 (General) TYPE Replica Set - 3 nodes BACKUPS Active

it happens some times only. some times i dont see these logs only not getting response from API which was working 5 min before.

it was working fine with given ip the ip is taken from AWS. it happens some times becomes normal after 10 mins