I am facing the issue of intermittent spikes in response latencies while fetching data in a sharded cluster. Data is always being queried via indexed fields.
Also seeing high memory usage on secondary boxes (memoryUsage:99% loadAvg:2.5) at exact same time as the latencies.
Client: Morphia Client with ReadPreference = PRIMARY, ReadConcern = Local, WriteConcern Default. As per my understanding secondaries should not affect the response if ReadConcern is Local.
Is there any correlation here?
MongoDB version 4.2.2
mongod instance running on 8 core, 40 GB RAM machine, wiredtiger cache 11 GB.
Can anybody suggest what might be the issue or how to debug this?