Nodejs Mongo query stream - CPU busy? Nodejs Mongo query stream - CPU busy? mongoose mongoose

Nodejs Mongo query stream - CPU busy?


Backpressure would likely cause your transform method to block. If the readable stream (mongo) is producing data fast enough, and the outstream storing fast enough, the CPU utilisation would be high if your transformer is doing anything significant. Your delays are throttling the transformer, reducing CPU load.

It's not clear in the docs what relevance the return result of push has, its possible it can be ignored (but that might just consume memory in the event of back pressure from the downstream).

I found your question as a result of my own quest for an answer!