Hi, I would like to know why the writeConcern w>1 is very slow for writes when de PRIMARY e SECONDARY are on the same network. I just want use SECONDARY for consistent READS for use in application. Below my tests.
As you increase your write concern your client is required to wait for asynchronous replication to replicate the written to n number of secondaries as specified in write concern.
The more consistent your write is configured to be the more time it might take to write the data…
Moreover, the more documents you write simultaneously the bigger the replication lag might be causing subsequent writes to get slower and slower as they are waiting longer.
Even though the members are in the same network does not mean that asynchronous replication can’t be impacted by disk,cpu or ram factors for slow operations.
Specific mongo versions might introduce additional behaviour on the way reads are impacting replication, be aware.