ChangeStream performance issue on single instance Mongodb


I installed standalone MongoDb and converted it to ReplSet with single instance. On clusters with 3 instances I’m getting 10-15 ms performance from change streams but in my single instance replset I’m getting 60-70ms event in the same message traffic with same server.

I’m using dotnet MongoDB.Driver with version 2.20.0 and MongoDb server with version 6.0.2. WriteConcern is W1 and ReadConcern is Majority since MongoDB does not allow another read concern on change stream.

Why single instance replset is giving much worse performance on change streams?

1 Like

Hopefully someone with internal knowledge of change stream will be able to shed some light on this.

I see one reason why it could be the case. May be the change stream is fed from secondaries so more stuff can happen in parallel. Which might explain why ReadConcern:Majority is the only read concern on change stream.

Just to be sure your single instance is running on the same hardware/VM setup as the multiple instances?

I’m guessing using a majority read the monitored changes will never be rolled back later. So this is a guarantee to the client side.

Not sure why it’s slower with single instance though.

1 Like