Closed tgoldenberg closed 8 years ago
Exception while polling query {"collectionName":"articles","selector":{},"options":{"transform":null,"fields":{"_id":true}}}:
MongoError: connection to [finance-production-mongodb-0.aqcqtyqs0tre1dl3mqmpmo4ogd.cx.internal.cloudapp.net:27000] timed out
Indicates that your app lost its connection to the mongodb service. At first glance, this doesn't appear to be an issue specifically with publish-counts. You may have better luck on the meteor forums.
If you're adamant that publish-counts is causing the problem, then my recommendation is to set up a test with publish-counts removed and verify that the db connection doesn't time-out. If it doesn't time-out, try creating your own observer with Mongo.Cursor.observe
[1] and verify the db connection doesn't time-out with that. If it does, then either Meteor or your MongoDB server is where the issue lies.
If the time-out doesn't occur, then I'm at a loss as to why publish-counts would instigate a time-out. At this point, I'd need a demo app that reproduces the problem as I have no experience deploying meteor apps.
@boxofrox pretty sure this is because the size of the collection was way to big, according to the spec for this package. On dev, we had maybe 1000 docs, but on staging, it would be in the 10s of 1000s. 90% sure that is what caused the remote DB connection to crash. As soon as I removed the package, everything worked fine. Just something to know for people who try to use it for way too large sets ;)
Thanks for the clarification, @tgoldenberg. This makes sense and is mentioned indirectly in the Notes section of the README [1]. Tmeasday clarified in #76 that this package is for counting small datasets only [2].
If you need to count large datasets, there's a link in the Notes section to arunoda's timer-based counting method.
I'll update the notes section so it's more obvious.
Cheers
When I use this package locally with
meteor run
I have no errors and it works great. When I usemeteor build
and deploy the app in production, my connection to mongo crashes. Here are the logs. I hope there is an answer to this problem.