SOLVED: I need to restart MongoDB every day, or it gets super slow and prevents connections

Kind of a big problem. Anyone know where to start?

I have replicaset enabled, everything is nice and fast for 20 concurrent connections, but after a day, the DB becomes super slow.

RAM issue? I have 32GB on a dedicated machine… for reference…

SOLUTION Get Kadira from NodeChef. Check your app for errors and fix them. Duh. :slight_smile:

Here’s after a FRESH reboot of all systems. My CPU is going crazy and there are 6 people online… :frowning:

Nothing here suggests that it’s a Meteor issue. I’d say, SSH into the box, and from the Mongo CLI run this:

You’ll find out which query is causing the problem. This should be a good starting point.

Out of curiosity, why not Galaxy + or similar?

Believe me, I want to. But I’m running an MMO, which is SUPER heavy on the CPU.

A mistake will cost me potentially thousands of dollars running on those guys. If I’m not careful… The base cost anyway is about $80 bucks a month. I tried running there originally, and my code was just so bad, it blew up their t1 services.

I had to self host on on much more powerful equipment until I was able to optimize.

For example… I just setup the new MongoDB server and guess what…


I started adding indexes and CPU started going down. Duh. Simple stuff.

Galaxy + Compose is what I’d like to get to one day…

Meteor APM aka Kadira can give you some useful stats, like the number of observers and fetches per minute for each collection etc.
You can now pay $10 to skip the messy setup:



I was so sad when Kadira went down, I had just started using it. I’m not a Galaxy customer, can I still get it working on my self hosted solution?!


Took like 5 minutes, and I’ve got my own private Kadira instance for like $10 bucks a month running. YES.

NodeChef supports the open source version of kadira Meteor APM as an addon that can be installed for your NodeChef account. You do not even have to deploy any applications to your NodeChef account to take advantage of this feature. You can use this service as is with your Meteor apps hosted on an external cloud service.

Can Kadira Meteor APM work with a localhost version?

Got an answer from NodeChef:

Should work fine for localhost version.

You should be able to run it on localhost, because you set API parameters and it communicates that way.

I don’t really care about localhost in this instance, as it’s so different from my production environment. :slight_smile:

Had to restart my DB server again today, I have a query that runs on unendingly. Once I fix that we should be LAUGHING. :slight_smile:

@herteby THANK you for pointing out NodeChef. I was able to discover that I had a notification system that was not properly deleting notifications.

So there were 850,000 notifications trying to get subscribed! DUH. Obvious problem right.

Kadira was able to show me that error.

The problem has been fixed! Thanks man, you’re a hero here.

1 Like