Hi Kevin,
As I told you, we never send any queries with w:Majority from our clients. But, you can see the following log , operation done on system.sessions by mongo is doing w:majority and taking long time. So it looks like the w:majority is done at different places in mongo as well which is impacting performance time to time. Please check the r/w acquire count.
This is from Primary
/var/log/mongodb-27951.log:2022-11-16T04:34:27.802+0000 I COMMAND [conn8648] command config.$cmd command: update { update: “system.sessions”, ordered: false, allowImplicitCollectionCreation: false, writeConcern: { w: “majority”, wtimeout: 15000 }, $db: “config” } numYields:0 reslen:3160 locks:{ ParallelBatchWriterMode: { acquireCount: { r: 30 } }, ReplicationStateTransition: { acquireCount: { w: 30 } }, Global: { acquireCount: { w: 30 } }, Database: { acquireCount: { w: 30 } }, Collection: { acquireCount: { w: 30 } }, Mutex: { acquireCount: { r: 60 } } } flowControl:{ acquireCount: 30, timeAcquiringMicros: 7 } storage:{} protocol:op_msg 679ms
and sedondary of a different replica-set as well.
/var/log/mongodb-27958.log:2022-11-16T04:34:27.547+0000 I COMMAND [conn8893] command config.$cmd command: update { update: “system.sessions”, ordered: false, allowImplicitCollectionCreation: false, writeConcern: { w: “majority”, wtimeout: 15000 }, $db: “config” } numYields:0 reslen:1899 locks:{ ParallelBatchWriterMode: { acquireCount: { r: 17 } }, ReplicationStateTransition: { acquireCount: { w: 17 } }, Global: { acquireCount: { w: 17 } }, Database: { acquireCount: { w: 17 } }, Collection: { acquireCount: { w: 17 } }, Mutex: { acquireCount: { r: 34 } } } flowControl:{ acquireCount: 17, timeAcquiringMicros: 2 } storage:{} protocol:op_msg 1612ms