|Get open subscriptions on Server||Chandika Jayasundara||7/9/13 9:54 AM|
I have multiple subscriptions subscribing to the same collection. After a recent change CPU consumption goes through the roof at seemingly random times. My suspicion is that some subscriptions are not getting stopped correctly and are causing issues.
Is there any way to find out how many subscriptions per collection are open etc. on the server?
|Re: Get open subscriptions on Server||Chris M||8/2/13 12:45 PM|
Anyone have an update on this? I'm having the same issue over here.
|Re: [meteor-talk] Get open subscriptions on Server||Arunoda Susiripala||8/2/13 4:51 PM|
Use Smart Collections. It solves this problem.
|Re: [meteor-talk] Get open subscriptions on Server||Chandika Jayasundara||8/2/13 8:15 PM|
I can attest to that. My idle was previously 25% CPU constantly with just about 10+ concurrent users and maxes out to 100% on some updates happening in a short period. With this I could never even imagine scaling the app to even support 100 users.
SC solves it, <3% avg CPU, never more than 5-6% CPU for peaks for about 20 or so users now.
Even though it's solved, it'll be great to know whats running right now on the server side so that it opens possibilities to debug other related issues.
|Re: Get open subscriptions on Server||Tim Haines||8/2/13 10:48 PM|
Hi Chandika and Chris,
I've found a way to monitor the polling that's occurring against mongo, and this has highlighted a bug I had in not stopping some observers correctly.
The way I did it was by altering the LiveResultsSet._pollMongo method. You'll find the method in the mongo-livedata package, inside the mongo_driver.js file. Just before the self._synchronousCursor.rewind(); line, you can add something along the lines of this:
And it will log the collection name and selector each time Mongo is polled.
|Re: [meteor-talk] Re: Get open subscriptions on Server||Arunoda Susiripala||8/2/13 10:52 PM|
Good idea Tim.
I can add some of the logs into Smart Collections which show what's happening behind the scene.
|Re: [meteor-talk] Re: Get open subscriptions on Server||Chandika Jayasundara||8/3/13 1:26 AM|
Thanks Tim. Should try it out.
Arunoda it will be great to have a sort of a debug mode so we can take a look at whats happening behind SC as well.