Meteor – High Network IO as it keeps polling MongoDB

I was working on a Meteor project which is connected to a mongoDB hosted on MongoLab. Since it is a sandbox plan, the oplog of the mongoDB instance is not available and in that case the Meteor will keep polling the mongoDB in around every 10 seconds. This causes a very high consumption on CPU and network bandwidth.

If you are running, Meteor 0.7.0 or above and your mongoDB has oplog enabled. You won’t experienced the problem.

Since the oplog is not available so the only workaround which i could think of is to unsubscribe the dataset. Here is a main.js which is executed when the app is loaded and when the user is idle for than 3 mins. Stop the subscription and that will stop polling the mongoDB.

var articleSubscription;

// Subscribe the articles on mongoDB
articleSubscription = Meteor.subscribe("articles", function () {
  console.log("Articles are ready");

Meteor.startup(function () {
  // Set timer to check if user is idle
  var idleTimer;
    // clear prior timeout, if any

    // create new timeout (3 mins)
    idleTimer = window.setTimeout(isIdle, 180000);

  function isIdle() {


Display a msg and ask the user to refresh if he wants to resume those stopped features.

Done =)



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.