Priority: Major - P3
Affects Version/s: 3.6.6
Fix Version/s: Backlog
Environment:MongoDB shell version v3.6.6
git version: 6405d65b1d6432e138b44c13085d0c2fe235d6bd
OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
We've noticed increased mongod CPU usage when trying to watch change streams.
One of our microservices tracks changes on 6 specially prepared collections and notifies clients when change occures. Service implemented in python (Pymongo 3.7.1). Part of relevant code below
Each service starts separate thread per each change stream (6 in total), we have total of 3 services in our cluster.
Tracked collections are relatively rarely changed (100-1000 changes per day).
Setup works as expected on single-node replica set. When trying to deploy on 3-node replica set we observing additional significant CPU consuming by mongod service. Our service remains fully functional and works as expected.
mongod CPU usage chart is attached.
mongod also reports slow getMore operations on tracked collections
Altering pipeline options (including empty pipelines) leads to no visible effect.
We've replaced our waiter thread with simple poller
and observed CPU usage dropped to usual levels.
Is this expected behaviour? How can we estimate change streams watching penalty?