I know we need to be carefull with publishing too much data. I’ve heard the stories about merge box issues related to CPU usage of the server.
I’m curious though. When will this “cost” start? Is it the definition of the publication (Meteor.publish) that will initiate the cost, or can you publish everything you want and the actual subscription initiates the cost? (E.g. will the server CPU shoot up by calling .publish on the server, or only after calling .subscribe on any connected client).
Actual answer is: it’s depend on your app. But based on our data at Kadira, CPU usage for subscriptions is based on few simple things:
Number of documents it initially sends
Number of documents it changes after that
Number of oplog changes coming this subscriptions
So, it’s totally fine for your subscriptions to keep as much as you want. It has no impact.
Basically, CPU usage increases when the number of subscriptions get increased.
You can do a CPU profile and find out where your app spends CPU.
Right now, we are working on a Live Query monitoring feature to Kadira. With that, we get get which publications are responsible for CPU issues. This is how it’s looks like.
Thanks for all the help, it helps altough it does feel like a whole can of works has just been opened As in, scaling is still something that doesn’t feel fixed without workarounds. The thing is, that we’re already being CPU limited with 5 users (although each will have a couple of sessions open, so let’s say 50 concurrent users). And that’s with an app that is not even writing a lot…
The O(no) number that keeps coming up anecdotally is 100 concurrent users in write heavy conditions. If you’re having issues with a mere 5 concurrent users, it’s not likely related to the oplog tailing issue.
Just as @arunoda suggested, profiling your app is what you need to do.
Of course. And we will . Hence this initial post in the forum to start and try to figure out what is a possible cause (or solution direction). Take note though, I did mention “50” concurrent users (sessions), busy users ;).